From 3f124f94894c93f8366819c518dc20ab4bf3b237 Mon Sep 17 00:00:00 2001 From: luo rixin Date: Thu, 20 Feb 2020 20:07:39 +0800 Subject: [PATCH] test/TestOSDScrub: fix mktime() error The var tm tm isn't initialized, when the tm.tm_isdst is a positive value, mktime(&tm) return -1 result in test failed in ubuntu 19.10 for aarch64 GLIBC2.30. Signed-off-by: luo rixin (cherry picked from commit 4806fce7f46899499549d9235ca87625d806f2da) --- src/test/osd/TestOSDScrub.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/osd/TestOSDScrub.cc b/src/test/osd/TestOSDScrub.cc index 34a3b8d81afae..55175726af947 100644 --- a/src/test/osd/TestOSDScrub.cc +++ b/src/test/osd/TestOSDScrub.cc @@ -71,6 +71,7 @@ TEST(TestOSDScrub, scrub_time_permit) { g_ceph_context->_conf.set_val("osd_scrub_end_hour", "24"); g_ceph_context->_conf.apply_changes(nullptr); tm tm; + tm.tm_isdst = -1; strptime("2015-01-16 12:05:13", "%Y-%m-%d %H:%M:%S", &tm); utime_t now = utime_t(mktime(&tm), 0); bool ret = osd->scrub_time_permit(now); -- 2.39.5