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: mktime + UTC problem


Daniel Drake <ddrake@brontes3d.com> writes:

> if I change:
>
> 	setenv("TZ", "", 1);
>
> to:
>
> 	setenv("TZ", "GMT0", 1);
>
> then the test program produces the expected results.

mktime doesn't care about TZ directly; it gets its data via localtime
and gmtime.  So I suspect that you can reproduce the bug by using only
localtime as well.  You can verify this by debugging mktime,
inspecting every time it calls localtime and/or gmtime, and checking
the results of these calls.  If my guess is right, you can then look
for the actual bug (either within localtime, or within your system
setup).  If my guess is wrong, please let us know the sequence of
calls to localtime/gmtime and what they return.

One thing that strikes me is that within glibc, TZ="" is equivalent to
TZ="Universal".  Perhaps the file /usr/share/zoneinfo/Universal is
corrupted on your troublesome system?  That would explain it right
there.


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