]> git.ipfire.org Git - thirdparty/glibc.git/commit
Ensure mktime sets errno on error [BZ #23789] aaribaud/bugzilla/23789/v4
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Wed, 24 Oct 2018 12:43:06 +0000 (14:43 +0200)
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Fri, 2 Nov 2018 06:03:52 +0000 (07:03 +0100)
commit134ae5ca82d3c5b5b9bab0ad145ffe8b1919a1ae
tree18ead43e7adb4d3260bbaed869c6de72350781bd
parent3ae3c4371df5a06d84096f9c6f7bfbe0d3c46a0d
Ensure mktime sets errno on error [BZ  #23789]

Posix mandates that mktime set errno to EOVERFLOW
on error, but the glibc mktime wasn't doing it so
far.

Fix this and add a test to prevent regressions.
The fix also fixes the same issue in timegm.

Tested with 'make check' on x86-linux-gnu and
i686-linux-gnu.

        * time/Makefile: Add bug-mktime4.
* time/bug-mktime4.c: New file.
* time/mktime.c
(__mktime_internal): Set errno to EOVERFLOW on error.
(mktime): Move call to __tzset inside conditional.
ChangeLog
time/Makefile
time/bug-mktime4.c [new file with mode: 0644]
time/mktime.c