1 Star 0 Fork 5

yelvens/luajit_anolis

forked from src-anolis-os/luajit 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0066-Fix-os.date-for-timezone-change-awareness.patch 1020 Bytes
一键复制 编辑 原始数据 按行查看 历史
xingwei-liu 提交于 2022-07-28 14:43 . init package version for an8.6
From 372bb8b22546663ba57e69fad75c97cfd004ac63 Mon Sep 17 00:00:00 2001
From: Vivien HENRIET <bubuabu@bubuabu.org>
Date: Wed, 30 Jan 2019 23:44:51 +0100
Subject: [PATCH 66/72] Fix os.date() for timezone change awareness
On POSIX target, system timezone change are not taken into account.
To reproduce,
1. call os.date()
2. change your timezone
3. call os.date() within the same luajit instance
On POSIX target, os.date use localtime_r to retrieve time.
On other target, the function localtime is used. But there is a behaviour
diference between these two function. localtime acts as if it called tzset
which localtime_r don't.
To fix the issue tzset is called before localtime_r.
---
src/lib_os.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lib_os.c b/src/lib_os.c
index ffbc3fd..09dc737 100644
--- a/src/lib_os.c
+++ b/src/lib_os.c
@@ -185,6 +185,7 @@ LJLIB_CF(os_date)
#endif
} else {
#if LJ_TARGET_POSIX
+ tzset();
stm = localtime_r(&t, &rtm);
#else
stm = localtime(&t);
--
2.20.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ihuang77/luajit_anolis.git
git@gitee.com:ihuang77/luajit_anolis.git
ihuang77
luajit_anolis
luajit_anolis
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385