This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Ensure mktime sets errno on error (bug 23789)
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
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).