summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'time.c')
-rw-r--r--time.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/time.c b/time.c
index b16ff0a6f1..fee12d34ff 100644
--- a/time.c
+++ b/time.c
@@ -1169,7 +1169,11 @@ init_leap_second_info(void)
struct vtm vtm;
wideval_t timew;
now = time(NULL);
+#ifdef HAVE_GMTIME_R
+ gmtime_r(&now, &result);
+#else
gmtime(&now);
+#endif
tm = gmtime_with_leapsecond(&now, &result);
if (!tm) return;
this_year = tm->tm_year;