Blame SOURCES/0066-Fix-os.date-for-timezone-change-awareness.patch

006bc1
From 372bb8b22546663ba57e69fad75c97cfd004ac63 Mon Sep 17 00:00:00 2001
006bc1
From: Vivien HENRIET <bubuabu@bubuabu.org>
006bc1
Date: Wed, 30 Jan 2019 23:44:51 +0100
006bc1
Subject: [PATCH 66/72] Fix os.date() for timezone change awareness
006bc1
006bc1
On POSIX target, system timezone change are not taken into account.
006bc1
To reproduce,
006bc1
1. call os.date()
006bc1
2. change your timezone
006bc1
3. call os.date() within the same luajit instance
006bc1
006bc1
On POSIX target, os.date use localtime_r to retrieve time.
006bc1
On other target, the function localtime is used. But there is a behaviour
006bc1
diference between these two function. localtime acts as if it called tzset
006bc1
which localtime_r don't.
006bc1
006bc1
To fix the issue tzset is called before localtime_r.
006bc1
---
006bc1
 src/lib_os.c | 1 +
006bc1
 1 file changed, 1 insertion(+)
006bc1
006bc1
diff --git a/src/lib_os.c b/src/lib_os.c
006bc1
index ffbc3fd..09dc737 100644
006bc1
--- a/src/lib_os.c
006bc1
+++ b/src/lib_os.c
006bc1
@@ -185,6 +185,7 @@ LJLIB_CF(os_date)
006bc1
 #endif
006bc1
   } else {
006bc1
 #if LJ_TARGET_POSIX
006bc1
+    tzset();
006bc1
     stm = localtime_r(&t, &rtm;;
006bc1
 #else
006bc1
     stm = localtime(&t);
006bc1
-- 
006bc1
2.20.1
006bc1