From: luo rixin Date: Thu, 20 Feb 2020 12:07:39 +0000 (+0800) Subject: test/TestOSDScrub: fix mktime() error X-Git-Tag: v14.2.22~27^2~5^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3f124f94894c93f8366819c518dc20ab4bf3b237;p=ceph.git 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) --- 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);