This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Ensure mktime sets errno on error (bug 23789)
On Thu, 25 Oct 2018, Albert ARIBAUD wrote:
> Posix, but apart from that, I can't see a way to keep __mktime_internal
> really internal (i.e., not touch errno) without making the code more
> complex than it should; so I will move the setting of errno in
If you did want to avoid __mktime_internal setting errno (and in this case
it seems best for it to set errno, since both callers expect such errno
setting and there may be errors other than EOVERFLOW), you'd change the
interface, so it e.g. returns an error number and uses a pointer to return
the time value (for example).
> I don't think I need to add a test for timegm(), though.
Not for this patch. At some point in the Y2038 series you'll presumably
add a version of timegm for _TIME_BITS=64, and that will need testing;
since there are no tests for timegm in the glibc testsuite at all, it
would be appropriate then to add a test that gets built and run both with
and without _TIME_BITS=64, so the existing function gets tested as well as
the new one.
--
Joseph S. Myers
joseph@codesourcery.com