* [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors
@ 2026-06-29 17:16 Evgeniy Temirgaleev via Tarantool-patches
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time() Evgeniy Temirgaleev via Tarantool-patches
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Evgeniy Temirgaleev via Tarantool-patches @ 2026-06-29 17:16 UTC (permalink / raw)
To: Sergey Kaplun, Sergey Bronnikov; +Cc: tarantool-patches
This patchset fixes os.time() to make -1 time value 'legal' if no error occurs.
Branch: https://github.com/tarantool/luajit/tree/tmr_g/lj-1470-os-time-epoch-minus-1s
Related issues:
* https://github.com/tarantool/tarantool/issues/12480
* https://github.com/LuaJIT/LuaJIT/issues/1470
Mike Pall (2):
Fix corner case of os.time().
Make check in os.time() consistent.
src/lib_os.c | 3 ++-
.../lj-1470-os-time-epoch-minus-1s.test.lua | 12 ++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
--
2.49.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time().
2026-06-29 17:16 [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors Evgeniy Temirgaleev via Tarantool-patches
@ 2026-06-29 17:21 ` Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 10:05 ` Sergey Kaplun via Tarantool-patches
2026-06-30 14:18 ` Sergey Bronnikov via Tarantool-patches
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 14:55 ` [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors Sergey Kaplun via Tarantool-patches
2 siblings, 2 replies; 10+ messages in thread
From: Evgeniy Temirgaleev via Tarantool-patches @ 2026-06-29 17:21 UTC (permalink / raw)
To: Sergey Kaplun, Sergey Bronnikov; +Cc: tarantool-patches
From: Mike Pall <mike>
Thanks to Temir Galeev. #1470
(cherry picked from commit 72d2061ae2fa9a5fd45237943f9982baf59435ec)
This patch fixes invalid os.time(t) behavior, when it handles -1 time value
as a fail of the libc mktime() regardless of the errno value.
Temir Galeev:
* added the description and the test for the patch
Part of tarantool/tarantool#12480
---
src/lib_os.c | 3 ++-
.../lj-1470-os-time-epoch-minus-1s.test.lua | 12 ++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
diff --git a/src/lib_os.c b/src/lib_os.c
index ffbc3fdc..f6841357 100644
--- a/src/lib_os.c
+++ b/src/lib_os.c
@@ -242,9 +242,10 @@ LJLIB_CF(os_time)
ts.tm_mon = getfield(L, "month", -1) - 1;
ts.tm_year = getfield(L, "year", -1) - 1900;
ts.tm_isdst = getboolfield(L, "isdst");
+ errno = 0;
t = mktime(&ts);
}
- if (t == (time_t)(-1))
+ if (t == (time_t)(-1) && errno != 0)
lua_pushnil(L);
else
lua_pushnumber(L, (lua_Number)t);
diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
new file mode 100644
index 00000000..6b5703e4
--- /dev/null
+++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
@@ -0,0 +1,12 @@
+local tap = require('tap')
+
+-- The test file demonstrates os.time() fail to return -1 time value.
+-- See also: https://github.com/LuaJIT/LuaJIT/issues/1470.
+local test = tap.test('lj-1470-os-time-epoch-minus-1s')
+
+test:plan(1)
+
+local minus_1s_time = os.date("*t", -1)
+test:is(os.time(minus_1s_time), -1, 'correct os.time()')
+
+test:done(true)
--
2.49.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent.
2026-06-29 17:16 [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors Evgeniy Temirgaleev via Tarantool-patches
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time() Evgeniy Temirgaleev via Tarantool-patches
@ 2026-06-29 17:21 ` Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 10:08 ` Sergey Kaplun via Tarantool-patches
2026-06-30 14:20 ` Sergey Bronnikov via Tarantool-patches
2026-06-30 14:55 ` [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors Sergey Kaplun via Tarantool-patches
2 siblings, 2 replies; 10+ messages in thread
From: Evgeniy Temirgaleev via Tarantool-patches @ 2026-06-29 17:21 UTC (permalink / raw)
To: Sergey Kaplun, Sergey Bronnikov; +Cc: tarantool-patches
From: Mike Pall <mike>
Thanks to Temir Galeev. #1470
(cherry picked from commit 295d45fb26de56498782c94594f31b97aef744ef)
This patch prevents os.time() to return nil, when machine time is -1
and some error occurs before os.time() call. In fact, this is
a theoretical case, so no tests were added.
Temir Galeev:
* added the description for the patch
Part of tarantool/tarantool#12480
---
src/lib_os.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib_os.c b/src/lib_os.c
index f6841357..d4054eae 100644
--- a/src/lib_os.c
+++ b/src/lib_os.c
@@ -229,6 +229,7 @@ LJLIB_CF(os_date)
LJLIB_CF(os_time)
{
time_t t;
+ errno = 0;
if (lua_isnoneornil(L, 1)) { /* called without args? */
t = time(NULL); /* get current time */
} else {
@@ -242,7 +243,6 @@ LJLIB_CF(os_time)
ts.tm_mon = getfield(L, "month", -1) - 1;
ts.tm_year = getfield(L, "year", -1) - 1900;
ts.tm_isdst = getboolfield(L, "isdst");
- errno = 0;
t = mktime(&ts);
}
if (t == (time_t)(-1) && errno != 0)
--
2.49.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time().
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time() Evgeniy Temirgaleev via Tarantool-patches
@ 2026-06-30 10:05 ` Sergey Kaplun via Tarantool-patches
2026-06-30 13:53 ` Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 14:18 ` Sergey Bronnikov via Tarantool-patches
1 sibling, 1 reply; 10+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2026-06-30 10:05 UTC (permalink / raw)
To: Evgeniy Temirgaleev; +Cc: tarantool-patches
Hi, Evgeniy!
Thanks for the patch!
LGTM, with minor nits below.
On 29.06.26, Evgeniy Temirgaleev wrote:
> From: Mike Pall <mike>
>
> Thanks to Temir Galeev. #1470
Please strip the issue number to avoid overmentioning the ticket on
GitHub. (The Issue can be easily found by the cherry-picked commit,
though). This helps to avoid overmentioning during the review and
applying the patch to long-term branches.
>
> (cherry picked from commit 72d2061ae2fa9a5fd45237943f9982baf59435ec)
>
> This patch fixes invalid os.time(t) behavior, when it handles -1 time value
Typo: s/, when/ when/
Typo: s/-1/the -1/
> as a fail of the libc mktime() regardless of the errno value.
>
> Temir Galeev:
> * added the description and the test for the patch
>
> Part of tarantool/tarantool#12480
> ---
> src/lib_os.c | 3 ++-
> .../lj-1470-os-time-epoch-minus-1s.test.lua | 12 ++++++++++++
> 2 files changed, 14 insertions(+), 1 deletion(-)
> create mode 100644 test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
>
> diff --git a/src/lib_os.c b/src/lib_os.c
> index ffbc3fdc..f6841357 100644
> --- a/src/lib_os.c
> +++ b/src/lib_os.c
> @@ -242,9 +242,10 @@ LJLIB_CF(os_time)
> ts.tm_mon = getfield(L, "month", -1) - 1;
> ts.tm_year = getfield(L, "year", -1) - 1900;
> ts.tm_isdst = getboolfield(L, "isdst");
> + errno = 0;
> t = mktime(&ts);
> }
> - if (t == (time_t)(-1))
> + if (t == (time_t)(-1) && errno != 0)
> lua_pushnil(L);
> else
> lua_pushnumber(L, (lua_Number)t);
> diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> new file mode 100644
> index 00000000..6b5703e4
> --- /dev/null
> +++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> @@ -0,0 +1,12 @@
> +local tap = require('tap')
> +
> +-- The test file demonstrates os.time() fail to return -1 time value.
Side note: It looks like the patch is outdated compared to the branch.
> +-- See also: https://github.com/LuaJIT/LuaJIT/issues/1470.
> +local test = tap.test('lj-1470-os-time-epoch-minus-1s')
> +
> +test:plan(1)
> +
> +local minus_1s_time = os.date("*t", -1)
Nit: We use everywhere in Lua code single quotes if possible (see other
tests).
> +test:is(os.time(minus_1s_time), -1, 'correct os.time()')
> +
> +test:done(true)
> --
> 2.49.0
>
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent.
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent Evgeniy Temirgaleev via Tarantool-patches
@ 2026-06-30 10:08 ` Sergey Kaplun via Tarantool-patches
2026-06-30 13:57 ` Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 14:20 ` Sergey Bronnikov via Tarantool-patches
1 sibling, 1 reply; 10+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2026-06-30 10:08 UTC (permalink / raw)
To: Evgeniy Temirgaleev; +Cc: tarantool-patches
Hi, Evgeniy!
Thanks for the patch!
LGTM, with a few nits regarding the commit message.
On 29.06.26, Evgeniy Temirgaleev wrote:
> From: Mike Pall <mike>
>
> Thanks to Temir Galeev. #1470
Please strip the issue number here. See the rationale in the response to
the previous patch.
>
> (cherry picked from commit 295d45fb26de56498782c94594f31b97aef744ef)
>
> This patch prevents os.time() to return nil, when machine time is -1
Typo: s/to return nil/from returning nil/
> and some error occurs before os.time() call. In fact, this is
Typo: s/os.time() call/the os.time() call/
> a theoretical case, so no tests were added.
>
> Temir Galeev:
> * added the description for the patch
>
> Part of tarantool/tarantool#12480
> ---
<snipped>
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time().
2026-06-30 10:05 ` Sergey Kaplun via Tarantool-patches
@ 2026-06-30 13:53 ` Evgeniy Temirgaleev via Tarantool-patches
0 siblings, 0 replies; 10+ messages in thread
From: Evgeniy Temirgaleev via Tarantool-patches @ 2026-06-30 13:53 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 3575 bytes --]
Hi, Sergey!
Thanks for the review!
Fixed your comments and force-pushed the branch.
>
> From: Sergey Kaplun <skaplun@tarantool.org>
> To: Evgeniy Temirgaleev <e.temirgaleev@tarantool.org>
> Cc: Sergey Bronnikov <sergeyb@tarantool.org>, tarantool-patches@dev.tarantool.org
>
> Date: Tuesday, June 30, 2026 1:06 PM +03:00
> Hi, Evgeniy!
> Thanks for the patch!
> LGTM, with minor nits below.
>
> On 29.06.26, Evgeniy Temirgaleev wrote:
> > From: Mike Pall <mike>
> >
> > Thanks to Temir Galeev. #1470
>
>
>
> Please strip the issue number to avoid overmentioning the ticket on
> GitHub. (The Issue can be easily found by the cherry-picked commit,
> though). This helps to avoid overmentioning during the review and
> applying the patch to long-term branches.
>
Removed.
>
>
> >
> > (cherry picked from commit 72d2061ae2fa9a5fd45237943f9982baf59435ec)
> >
> > This patch fixes invalid os.time(t) behavior, when it handles -1 time
> value
>
> Typo: s/, when/ when/
> Typo: s/-1/the -1/
>
Fixed.
>
>
> > as a fail of the libc mktime() regardless of the errno value.
> >
> > Temir Galeev:
> > * added the description and the test for the patch
> >
> > Part of tarantool/tarantool#12480
> > ---
> > src/lib_os.c | 3 ++-
> > .../lj-1470-os-time-epoch-minus-1s.test.lua | 12 ++++++++++++
> > 2 files changed, 14 insertions(+), 1 deletion(-)
> > create mode 100644
> test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> >
> > diff --git a/src/lib_os.c b/src/lib_os.c
> > index ffbc3fdc..f6841357 100644
> > --- a/src/lib_os.c
> > +++ b/src/lib_os.c
> > @@ -242,9 +242,10 @@ LJLIB_CF(os_time)
> > ts.tm_mon = getfield(L, "month", -1) - 1;
> > ts.tm_year = getfield(L, "year", -1) - 1900;
> > ts.tm_isdst = getboolfield(L, "isdst");
> > + errno = 0;
> > t = mktime(&ts);
> > }
> > - if (t == (time_t)(-1))
> > + if (t == (time_t)(-1) && errno != 0)
> > lua_pushnil(L);
> > else
> > lua_pushnumber(L, (lua_Number)t);
> > diff --git
> a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> > new file mode 100644
> > index 00000000..6b5703e4
> > --- /dev/null
> > +++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> > @@ -0,0 +1,12 @@
> > +local tap = require('tap')
> > +
> > +-- The test file demonstrates os.time() fail to return -1 time value.
>
> Side note: It looks like the patch is outdated compared to the branch.
>
Yes, thanks!
>
>
> > +-- See also: https://github.com/LuaJIT/LuaJIT/issues/1470.
> > +local test = tap.test('lj-1470-os-time-epoch-minus-1s')
> > +
> > +test:plan(1)
> > +
> > +local minus_1s_time = os.date("*t", -1)
>
> Nit: We use everywhere in Lua code single quotes if possible (see other
> tests).
>
Fixed.
======================================
diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
index aa913607..dfe1ee11 100644
--- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
+++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
@@ -7,7 +7,7 @@ local test = tap.test('lj-1470-os-time-epoch-minus-1s')
test:plan(1)
-local minus_1s_time = os.date("*t", -1)
+local minus_1s_time = os.date('*t', -1)
test:is(os.time(minus_1s_time), -1, 'correct os.time()')
test:done(true)
======================================
>
>
> > +test:is(os.time(minus_1s_time), -1, 'correct os.time()')
> > +
> > +test:done(true)
> > --
> > 2.49.0
> >
>
> --
> Best regards,
> Sergey Kaplun
>
--
Best regards,
Evgeniy Temirgaleev
[-- Attachment #2: Type: text/html, Size: 7737 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent.
2026-06-30 10:08 ` Sergey Kaplun via Tarantool-patches
@ 2026-06-30 13:57 ` Evgeniy Temirgaleev via Tarantool-patches
0 siblings, 0 replies; 10+ messages in thread
From: Evgeniy Temirgaleev via Tarantool-patches @ 2026-06-30 13:57 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]
Hi, Sergey! Thanks for the review!
Fixed your comments and force-pushed the branch.
>
> From: Sergey Kaplun <skaplun@tarantool.org>
> To: Evgeniy Temirgaleev <e.temirgaleev@tarantool.org>
> Cc: Sergey Bronnikov <sergeyb@tarantool.org>, tarantool-patches@dev.tarantool.org
>
> Date: Tuesday, June 30, 2026 1:09 PM +03:00
> Hi, Evgeniy!
> Thanks for the patch!
> LGTM, with a few nits regarding the commit message.
>
> On 29.06.26, Evgeniy Temirgaleev wrote:
> > From: Mike Pall <mike>
> >
> > Thanks to Temir Galeev. #1470
>
> Please strip the issue number here. See the rationale in the response to
> the previous patch.
>
Removed.
>
>
> >
> > (cherry picked from commit 295d45fb26de56498782c94594f31b97aef744ef)
> >
> > This patch prevents os.time() to return nil, when machine time is -1
>
> Typo: s/to return nil/from returning nil/
>
Fixed.
>
>
> > and some error occurs before os.time() call. In fact, this is
>
> Typo: s/os.time() call/the os.time() call/
>
Fixed.
>
>
> > a theoretical case, so no tests were added.
> >
> > Temir Galeev:
> > * added the description for the patch
> >
> > Part of tarantool/tarantool#12480
> > ---
>
> <snipped>
>
> --
> Best regards,
> Sergey Kaplun
>
--
Best regards,
Evgeniy Temirgaleev
[-- Attachment #2: Type: text/html, Size: 2966 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time().
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time() Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 10:05 ` Sergey Kaplun via Tarantool-patches
@ 2026-06-30 14:18 ` Sergey Bronnikov via Tarantool-patches
1 sibling, 0 replies; 10+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2026-06-30 14:18 UTC (permalink / raw)
To: Evgeniy Temirgaleev, Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1944 bytes --]
Hi, Evgeniy!
Thanks for the patch! LGTM
Sergey
On 6/29/26 20:21, Evgeniy Temirgaleev wrote:
> From: Mike Pall <mike>
>
> Thanks to Temir Galeev. #1470
>
> (cherry picked from commit 72d2061ae2fa9a5fd45237943f9982baf59435ec)
>
> This patch fixes invalid os.time(t) behavior, when it handles -1 time value
> as a fail of the libc mktime() regardless of the errno value.
>
> Temir Galeev:
> * added the description and the test for the patch
>
> Part of tarantool/tarantool#12480
> ---
> src/lib_os.c | 3 ++-
> .../lj-1470-os-time-epoch-minus-1s.test.lua | 12 ++++++++++++
> 2 files changed, 14 insertions(+), 1 deletion(-)
> create mode 100644 test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
>
> diff --git a/src/lib_os.c b/src/lib_os.c
> index ffbc3fdc..f6841357 100644
> --- a/src/lib_os.c
> +++ b/src/lib_os.c
> @@ -242,9 +242,10 @@ LJLIB_CF(os_time)
> ts.tm_mon = getfield(L, "month", -1) - 1;
> ts.tm_year = getfield(L, "year", -1) - 1900;
> ts.tm_isdst = getboolfield(L, "isdst");
> + errno = 0;
> t = mktime(&ts);
> }
> - if (t == (time_t)(-1))
> + if (t == (time_t)(-1) && errno != 0)
> lua_pushnil(L);
> else
> lua_pushnumber(L, (lua_Number)t);
> diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> new file mode 100644
> index 00000000..6b5703e4
> --- /dev/null
> +++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> @@ -0,0 +1,12 @@
> +local tap = require('tap')
> +
> +-- The test file demonstrates os.time() fail to return -1 time value.
> +-- See also:https://github.com/LuaJIT/LuaJIT/issues/1470.
> +local test = tap.test('lj-1470-os-time-epoch-minus-1s')
> +
> +test:plan(1)
> +
> +local minus_1s_time = os.date("*t", -1)
> +test:is(os.time(minus_1s_time), -1, 'correct os.time()')
> +
> +test:done(true)
[-- Attachment #2: Type: text/html, Size: 2519 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent.
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 10:08 ` Sergey Kaplun via Tarantool-patches
@ 2026-06-30 14:20 ` Sergey Bronnikov via Tarantool-patches
1 sibling, 0 replies; 10+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2026-06-30 14:20 UTC (permalink / raw)
To: Evgeniy Temirgaleev, Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]
Hi, Evgeniy!
Thanks for the patch! LGTM
Sergey
On 6/29/26 20:21, Evgeniy Temirgaleev wrote:
> From: Mike Pall <mike>
>
> Thanks to Temir Galeev. #1470
>
> (cherry picked from commit 295d45fb26de56498782c94594f31b97aef744ef)
>
> This patch prevents os.time() to return nil, when machine time is -1
> and some error occurs before os.time() call. In fact, this is
> a theoretical case, so no tests were added.
>
> Temir Galeev:
> * added the description for the patch
>
> Part of tarantool/tarantool#12480
> ---
> src/lib_os.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib_os.c b/src/lib_os.c
> index f6841357..d4054eae 100644
> --- a/src/lib_os.c
> +++ b/src/lib_os.c
> @@ -229,6 +229,7 @@ LJLIB_CF(os_date)
> LJLIB_CF(os_time)
> {
> time_t t;
> + errno = 0;
> if (lua_isnoneornil(L, 1)) { /* called without args? */
> t = time(NULL); /* get current time */
> } else {
> @@ -242,7 +243,6 @@ LJLIB_CF(os_time)
> ts.tm_mon = getfield(L, "month", -1) - 1;
> ts.tm_year = getfield(L, "year", -1) - 1900;
> ts.tm_isdst = getboolfield(L, "isdst");
> - errno = 0;
> t = mktime(&ts);
> }
> if (t == (time_t)(-1) && errno != 0)
[-- Attachment #2: Type: text/html, Size: 1662 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors
2026-06-29 17:16 [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors Evgeniy Temirgaleev via Tarantool-patches
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time() Evgeniy Temirgaleev via Tarantool-patches
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent Evgeniy Temirgaleev via Tarantool-patches
@ 2026-06-30 14:55 ` Sergey Kaplun via Tarantool-patches
2 siblings, 0 replies; 10+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2026-06-30 14:55 UTC (permalink / raw)
To: Evgeniy Temirgaleev; +Cc: tarantool-patches
Evgeniy,
Thanks for the patch-set and fixes!
LGTM!
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-06-30 14:56 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 17:16 [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors Evgeniy Temirgaleev via Tarantool-patches
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 1/2] Fix corner case of os.time() Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 10:05 ` Sergey Kaplun via Tarantool-patches
2026-06-30 13:53 ` Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 14:18 ` Sergey Bronnikov via Tarantool-patches
2026-06-29 17:21 ` [Tarantool-patches] [PATCH luajit 2/2] Make check in os.time() consistent Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 10:08 ` Sergey Kaplun via Tarantool-patches
2026-06-30 13:57 ` Evgeniy Temirgaleev via Tarantool-patches
2026-06-30 14:20 ` Sergey Bronnikov via Tarantool-patches
2026-06-30 14:55 ` [Tarantool-patches] [PATCH luajit 0/2] Fix os.time() to use errno to detect errors Sergey Kaplun via Tarantool-patches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox