This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: A patch for mktime.c and tz*.c.
- To: hjl@lucon.org
- Subject: Re: A patch for mktime.c and tz*.c.
- From: Paul Eggert <eggert@twinsun.com>
- Date: Fri, 6 Nov 1998 18:32:50 -0800 (PST)
- CC: drepper@cygnus.com, libc-hacker@cygnus.com
- References: <m0zbxzD-0000V3C@sea.lucon.org>
From: hjl@lucon.org (H.J. Lu)
Date: Fri, 6 Nov 1998 18:20:23 -0800 (PST)
FWIW, I discovered those mktime bugs with VSX-PCT. It failed
with GMT0BST. At lease, my change passes VSX-PCT.
I understand that glibc 2.0.100 passes the test cases. (I haven't run
them myself.) So perhaps your concerns are moot.
So __daylight indicates if DST was, is, or will be in effect
at the given time.
But this is logically equivalent to saying ``DST is in effect at some
point in time''. I.e. the ``given time'' has nothing to do with
__daylight.
Does glibc 2 know the offset between SDT and DST at the given time?
If the answer is no, there is a bug in glibc 2. If the answer is
yes, which I believe is the case, I store the offset in __daylight
and use it in mktime.
The patch that you sent does not behave the way that you describe.
E.g. the patch has __tzfile_read set __daylight. But this action
occurs rarely, only at the start of the program, and after TZ changes;
it doesn't occur for each ``given time''. So (in general) it will
disagree with the difference between standard time and DST at ``the
given time''.