aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2026-06-13 11:00:59 +0200
committerMike Pall <mike>2026-06-13 11:00:59 +0200
commit194d7f2d635a11193177f0ed820ae419148f0b70 (patch)
tree9f5b3053d1b648c66b4de56c8f2a8f7baa8bb3b9 /src
parentb925b3e3fc6771171602323b45fbe9fb8fc90369 (diff)
parent72d2061ae2fa9a5fd45237943f9982baf59435ec (diff)
downloadluajit-194d7f2d635a11193177f0ed820ae419148f0b70.tar.gz
luajit-194d7f2d635a11193177f0ed820ae419148f0b70.tar.bz2
luajit-194d7f2d635a11193177f0ed820ae419148f0b70.zip
Merge branch 'master' into v2.1
Diffstat (limited to 'src')
-rw-r--r--src/lib_os.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib_os.c b/src/lib_os.c
index 7821fc1fd..bf1749151 100644
--- a/src/lib_os.c
+++ b/src/lib_os.c
@@ -243,9 +243,10 @@ LJLIB_CF(os_time)
243 ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u); 243 ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u);
244 ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u); 244 ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u);
245 ts.tm_isdst = getboolfield(L, "isdst"); 245 ts.tm_isdst = getboolfield(L, "isdst");
246 errno = 0;
246 t = mktime(&ts); 247 t = mktime(&ts);
247 } 248 }
248 if (t == (time_t)(-1)) 249 if (t == (time_t)(-1) && errno != 0)
249 lua_pushnil(L); 250 lua_pushnil(L);
250 else 251 else
251 lua_pushnumber(L, (lua_Number)t); 252 lua_pushnumber(L, (lua_Number)t);