[PATCH v3] Ensure mktime sets errno on error (bug 23789)

Joseph Myers joseph@codesourcery.com
Tue Oct 30 00:26:00 GMT 2018


On Tue, 30 Oct 2018, Albert ARIBAUD (3ADEV) wrote:

> 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.
> 
> The test was run through 'make check' on i686-linux-gnu,
> then the fix was added and 'make check' run again.

I strongly advise testing this sort of thing on both 32-bit *and* 64-bit 
platforms, given the likelihood of differences when time_t is 64-bit.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list