This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
   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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]