]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix arguments to localtime_r
authorAlan T. DeKok <aland@freeradius.org>
Mon, 7 Oct 2019 14:42:18 +0000 (10:42 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 7 Oct 2019 14:42:18 +0000 (10:42 -0400)
src/lib/util/time.c

index 3a10eded07b6d6d8cd53a8a01e09e3f022b9e705..9084a04aa912141a9bc2085e079afe48b6339385 100644 (file)
@@ -74,6 +74,7 @@ static uint64_t                               our_mach_epoch;
 static inline int fr_time_sync(void)
 {
        struct tm tm;
+       time_t now;
 
        /*
         *      our_realtime represents system time
@@ -122,7 +123,8 @@ static inline int fr_time_sync(void)
         *      Get local time zone name, daylight savings, and GMT
         *      offsets.
         */
-       (void) localtime_r(time(NULL), &tm);
+       now = time(NULL);
+       (void) localtime_r(&now, &tm);
 
        isdst = (tm.tm_isdst != 0);
        tz_names[isdst] = tm.tm_zone;