diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-10-26 11:11:28 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-10-26 11:11:28 +0000 |
commit | 0e103c6d2a8483b6aa448f319b453ef2a6c796af (patch) | |
tree | b49c3bf5f583d1a935abe1ffe3d9ed25d709bf1b /time | |
parent | 14f65de69493dee805645c0a782885727d5bdac6 (diff) | |
download | glibc-0e103c6d2a8483b6aa448f319b453ef2a6c796af.tar glibc-0e103c6d2a8483b6aa448f319b453ef2a6c796af.tar.gz glibc-0e103c6d2a8483b6aa448f319b453ef2a6c796af.tar.bz2 glibc-0e103c6d2a8483b6aa448f319b453ef2a6c796af.zip |
Update.
1998-10-26 11:09 Ulrich Drepper <drepper@cygnus.com>
* time/Makefile (tests): Add tst-posixtz.
* time/tst-posixtz.c: New file.
1998-10-24 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* elf/rtld.c (process_envvars): Accept any non-null value of
LD_BIND_NOW, as mandated by the ABI.
1998-10-24 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* sysdeps/unix/sysv/linux/pread.c: Rename __syscall_pread64 to
__syscall_pread.
* sysdeps/unix/sysv/linux/pwrite.c: Rename __syscall_pwrite64 to
__syscall_pwrite.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/powerpc/syscalls.list: Likewise. Remove
duplicate entries.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove
s_pread64 and s_pwrite64.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Likewise.
1998-10-24 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* sysdeps/unix/sysv/linux/llseek.c: Use INLINE_SYSCALL.
* sysdeps/unix/sysv/linux/arm/syscalls.list: Rename __sys_llseek
to __syscall__llseek.
* sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/syscalls.list: Remove entry for
__sys_llseek.
1998-10-26 Cristian Gafton <gafton@redhat.com>
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Add s_setfsgid
and s_setfsuid.
1998-10-26 Ulrich Drepper <drepper@cygnus.com>
* time/tzset.c (tz_compute): Correct last patch and describe this
in a comment.
Diffstat (limited to 'time')
-rw-r--r-- | time/Makefile | 2 | ||||
-rw-r--r-- | time/tst-posixtz.c | 55 | ||||
-rw-r--r-- | time/tzset.c | 2 |
3 files changed, 57 insertions, 2 deletions
diff --git a/time/Makefile b/time/Makefile index 170639d884..7620d622a1 100644 --- a/time/Makefile +++ b/time/Makefile @@ -30,7 +30,7 @@ routines := offtime asctime clock ctime ctime_r difftime \ stime dysize timegm ftime \ strptime getdate strfxtime -tests := test_time clocktest +tests := test_time clocktest tst-posixtz include ../Rules diff --git a/time/tst-posixtz.c b/time/tst-posixtz.c new file mode 100644 index 0000000000..00a16499f3 --- /dev/null +++ b/time/tst-posixtz.c @@ -0,0 +1,55 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +struct +{ + time_t when; + const char *tz; + const char *result; +} tests[] = +{ + { 909312849L, "AEST-10AEDST-11,M10.5.0,M3.5.0", + "1998/10/25 21:54:09 dst=1 zone=AEDST" }, + { 924864849L, "AEST-10AEDST-11,M10.5.0,M3.5.0", + "1999/04/23 20:54:09 dst=0 zone=AEST" }, +}; + +int +main (void) +{ + int result = 0; + int cnt; + + for (cnt = 0; cnt < sizeof (tests) / sizeof (tests[0]); ++cnt) + { + char buf[100]; + struct tm *tmp; + + printf ("TZ = \"%s\", time = %ld => ", tests[cnt].tz, tests[cnt].when); + fflush (stdout); + + setenv ("TZ", tests[cnt].tz, 1); + + tmp = localtime (&tests[cnt].when); + + snprintf (buf, sizeof (buf), + "%04d/%02d/%02d %02d:%02d:%02d dst=%d zone=%s", + tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday, + tmp->tm_hour, tmp->tm_min, tmp->tm_sec, tmp->tm_isdst, + tzname[tmp->tm_isdst ? 1 : 0]); + + fputs (buf, stdout); + + if (strcmp (buf, tests[cnt].result) == 0) + puts (", OK"); + else + { + result = 1; + puts (", FAIL"); + } + } + + return result; +} diff --git a/time/tzset.c b/time/tzset.c index 6b9f93239b..92e22083d5 100644 --- a/time/tzset.c +++ b/time/tzset.c @@ -524,7 +524,7 @@ tz_compute (timer, tm) For the later the daylight saving time ends in the next year. It is easier to detect this after first computing the time for the wrong year since now we simply can compare the times to switch. */ - if (tz_rules[0].change < tz_rules[1].change + if (tz_rules[0].change > tz_rules[1].change && ! compute_change (&tz_rules[1], 1900 + tm->tm_year + 1)) return 0; |