[tz] why does mktime binary search?

Paul Eggert eggert at cs.ucla.edu
Sun Jul 31 16:09:49 UTC 2016


Russ Allbery wrote:
> If you call a library function that is documented as
> setting errno, and it does not return an error, errno is undefined.

Yes, and this is a glitch in mktime's API: if mktime succeeds and returns 
(time_t)-1, errno might still be set. Although mktime's caller can detect 
whether (time_t)-1 represents an error by passing (time_t)-1 to localtime_r and 
comparing the resulting struct tm to the one that mktime returned, this is annoying.



More information about the tz mailing list