[PATCH] Fix mktime

Thorsten Kukuk kukuk@suse.de
Wed Apr 17 05:22:00 GMT 2002


On Sat, Apr 13, Jakub Jelinek wrote:

> Hi!
> 
> The PR libc/2738 fix was not entirely correct, since even tm with tm_year 69
> is representable in certain timezones. This caused e.g. perl-Date-Calc tests
> to fail. Below is a fix. Years before 69 surely cannot be represented, for
> 69 it computes the year and checks for overflow afterwards.
> 
> 2002-04-13  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* time/mktime.c (__mktime_internal): If year is 69, don't bail out
> 	early, but check whether it overflowed afterwards.
> 	* time/tst-mktime.c (main): Add new tests.

make check does not longer pass for me with this. Output of
tst-mktime.out is:

Wednesday
Dec 31 1969 EST test passed
mktime returned 3749, expected -1

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Deutschherrenstr. 15-19       D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B



More information about the Libc-hacker mailing list