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

Paul Eggert eggert@cs.ucla.edu
Thu Oct 25 20:20:00 GMT 2018


On 10/25/18 9:57 AM, Albert ARIBAUD wrote:
> - To distinguish 'old' vs proper errno from __tz_set(), we would need
>    it to return e.g. an int equal to 0 for success and -1 for failure,
>    so that mktime() could detect __tz_set() failure and return -1 while
>    preserving errno.

This sounds like the way to go. The other approach that you mentioned 
(saving and restoring errno a couple of times) would be more 
error-prone, particularly in non-glibc environments (remember, this code 
is shared with Gnulib).



More information about the Libc-alpha mailing list