aboutsummaryrefslogtreecommitdiff
path: root/time/mktime.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-04-15 06:37:43 +0000
committerUlrich Drepper <drepper@redhat.com>2002-04-15 06:37:43 +0000
commit78575a842bce4d8e8c725506da1f826d16b660eb (patch)
tree5167b04e3c2f195c79de8bb27d23194a88d78cc3 /time/mktime.c
parentfab656f5a776f09596b9e74f9a43f8300dd724c7 (diff)
downloadglibc-78575a842bce4d8e8c725506da1f826d16b660eb.tar
glibc-78575a842bce4d8e8c725506da1f826d16b660eb.tar.gz
glibc-78575a842bce4d8e8c725506da1f826d16b660eb.tar.bz2
glibc-78575a842bce4d8e8c725506da1f826d16b660eb.zip
Update.
2002-04-14 Jakub Jelinek <jakub@redhat.com> * elf/dl-lookup.c (_dl_lookup_symbol): Move add_dependency call to the end of the function. Pass original flags to recursive call if add_dependency failed. (_dl_lookup_versioned_symbol): Likewise. 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. * debug/xtrace.sh: Fix program name in help message. Patch by Roger Luethi <rl@hellgate.ch>.
Diffstat (limited to 'time/mktime.c')
-rw-r--r--time/mktime.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/time/mktime.c b/time/mktime.c
index 5632f14b78..1aec223e0e 100644
--- a/time/mktime.c
+++ b/time/mktime.c
@@ -259,8 +259,10 @@ __mktime_internal (struct tm *tp,
int sec_requested = sec;
- /* Only years after 1970 are defined. */
- if (year < 70)
+ /* Only years after 1970 are defined.
+ If year is 69, it might still be representable due to
+ timezone differences. */
+ if (year < 69)
return -1;
#if LEAP_SECONDS_POSSIBLE
@@ -370,6 +372,14 @@ __mktime_internal (struct tm *tp,
return -1;
}
+ if (year == 69)
+ {
+ /* If year was 69, need to check whether the time was representable
+ or not. */
+ if (t < 0 || t > 2 * 24 * 60 * 60)
+ return -1;
+ }
+
*tp = tm;
return t;
}