about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-03-10 19:34:45 +0000
committerJakub Jelinek <jakub@redhat.com>2009-03-10 19:34:45 +0000
commitd4c583b4466962a9d9d4ca54ab6108dc7b42cdcc (patch)
tree0c0ae0f76861d31a4fa7e351d88b6539364cf9e8
parent5c1d419918b3637170da9a5592049048aaf0ee49 (diff)
downloadglibc-d4c583b4466962a9d9d4ca54ab6108dc7b42cdcc.tar.gz
glibc-d4c583b4466962a9d9d4ca54ab6108dc7b42cdcc.tar.xz
glibc-d4c583b4466962a9d9d4ca54ab6108dc7b42cdcc.zip
Updated to fedora-glibc-20090310T1925 cvs/fedora-glibc-2_9_90-10
-rw-r--r--ChangeLog53
-rw-r--r--elf/sprof.c2
-rw-r--r--fedora/branch.mk4
-rw-r--r--fedora/glibc.spec.in6
-rw-r--r--include/stdio.h1
-rw-r--r--libio/fmemopen.c4
-rw-r--r--po/id.po89
-rw-r--r--posix/tst-sysconf.c2
-rw-r--r--posix/unistd.h18
-rw-r--r--stdlib/at_quick_exit.c1
-rw-r--r--stdlib/cxa_at_quick_exit.c1
-rw-r--r--stdlib/exit.c2
-rw-r--r--stdlib/exit.h6
-rw-r--r--stdlib/quick_exit.c2
-rw-r--r--sysdeps/powerpc/fpu/fenv_libc.h12
-rw-r--r--sysdeps/powerpc/fpu/tst-setcontext-fpscr.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S9
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S9
-rw-r--r--time/tst-posixtz.c30
-rw-r--r--time/tzset.c109
22 files changed, 239 insertions, 135 deletions
diff --git a/ChangeLog b/ChangeLog
index 486750aa3d..9e9558c95d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,56 @@
+2009-03-10  Ulrich Drepper  <drepper@redhat.com>
+
+	* time/tzset.c: Optimize a bit for size.
+
+2009-03-10  Jakub Jelinek  <jakub@redhat.com>
+
+	* include/stdio.h (fmemopen): Add libc_hidden_proto.
+	* libio/fmemopen.c (fmemopen): Add libc_hidden_def.
+
+	* elf/sprof.c: Avoid warning about multi-line comment.
+
+2009-03-10  Ulrich Drepper  <drepper@redhat.com>
+
+	* time/tzset.c (__tzset_parse_tz): Use correct string when parsing
+	DST name.
+	* time/tst-posixtz.c: Add tests for quoted timezone names.
+
+2009-03-10  Jakub Jelinek  <jakub@redhat.com>
+
+	* posix/unistd.h (_POSIX_VERSION, _POSIX2_VERSION, _POSIX2_C_BIND,
+	_POSIX2_C_DEV, _POSIX2_SW_DEV, _POSIX2_LOCALEDEF): Define to
+	200809L instead of 200112L.
+	(_XOPEN_VERSION): For __USE_XOPEN2K8 define to 700.
+	* posix/tst-sysconf.c (STDVER): Define to 200809L instead of 200112L.
+
+	* stdlib/quick_exit.c (quick_exit): Pass &__quick_exit_funcs
+	instead of __quick_exit_funcs to __run_exit_handlers.
+	* stdlib/at_quick_exit.c (at_quick_exit): Add attribute_hidden.
+	* stdlib/exit.h (__run_exit_handlers): Add noreturn attribute.
+	(__cxa_at_quick_exit): Remove attribute_hidden.
+	* stdlib/exit.c (exit): Pass &__exit_funcs instead of __exit_funcs
+	to __run_exit_handlers.
+	* stdlib/cxa_at_quick_exit.c (__cxa_at_quick_exit): Remove
+	attribute_hidden.
+
+2009-03-10  Ulrich Drepper  <drepper@redhat.com>
+
+	* po/id.po: Update from translation team.
+
+2009-02-18  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Use
+	.machine push; .machine "power6" and .machine pop around mtfsf
+	insns outside of _ARCH_PWR6 define.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
+	Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
+	Likewise.
+	* sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_SET_DI_FPSCR): Likewise.
+	* sysdeps/powerpc/fpu/fenv_libc.h (fesetenv_register,
+	relax_fenv_state): Likewise.
+
 2009-03-08  Ulrich Drepper  <drepper@redhat.com>
 
 	* stdlib/Makefile (routines): Add quick_exit, at_quick_exit, and
diff --git a/elf/sprof.c b/elf/sprof.c
index ad723f3416..fd4ffaeaba 100644
--- a/elf/sprof.c
+++ b/elf/sprof.c
@@ -87,7 +87,7 @@ static const struct argp_option options[] =
 
 /* Short description of program.  */
 static const char doc[] = N_("Read and display shared object profiling data.");
-//For bug reporting instructions, please see:\n		\
+//For bug reporting instructions, please see:\n
 //<http://www.gnu.org/software/libc/bugs.html>.\n");
 
 /* Strings for arguments in help texts.  */
diff --git a/fedora/branch.mk b/fedora/branch.mk
index c073feba08..bb315585f2 100644
--- a/fedora/branch.mk
+++ b/fedora/branch.mk
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-f8
-fedora-sync-date := 2009-03-09 14:21 UTC
-fedora-sync-tag := fedora-glibc-20090309T1421
+fedora-sync-date := 2009-03-10 19:25 UTC
+fedora-sync-tag := fedora-glibc-20090310T1925
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index 7376d722d2..cec16002d3 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -19,7 +19,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: @glibcversion@
-Release: 9
+Release: 10
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -1009,6 +1009,10 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Tue Mar 10 2009 Jakub Jelinek <jakub@redhat.com> 2.9.90-10
+- update from trunk
+  - fix atexit/__cxa_atexit
+
 * Mon Mar  9 2009 Jakub Jelinek <jakub@redhat.com> 2.9.90-9
 - update from trunk
   - POSIX 2008 support: -D_XOPEN_SOURCE=700 and -D_POSIX_C_SOURCE=200809L
diff --git a/include/stdio.h b/include/stdio.h
index d82728a845..9fdafe4a85 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -152,6 +152,7 @@ libc_hidden_proto (fread_unlocked)
 libc_hidden_proto (fwrite_unlocked)
 libc_hidden_proto (fgets_unlocked)
 libc_hidden_proto (fputs_unlocked)
+libc_hidden_proto (fmemopen)
 libc_hidden_proto (open_memstream)
 libc_hidden_proto (__libc_fatal)
 libc_hidden_proto (__vsprintf_chk)
diff --git a/libio/fmemopen.c b/libio/fmemopen.c
index b618ce585d..d3750fc7de 100644
--- a/libio/fmemopen.c
+++ b/libio/fmemopen.c
@@ -1,5 +1,6 @@
 /* Fmemopen implementation.
-   Copyright (C) 2000, 2002, 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Hanno Mueller, kontakt@hanno.de, 2000.
 
@@ -258,3 +259,4 @@ fmemopen (void *buf, size_t len, const char *mode)
 
   return _IO_fopencookie (c, mode, iof);
 }
+libc_hidden_def (fmemopen)
diff --git a/po/id.po b/po/id.po
index 984cb9aa00..777a556329 100644
--- a/po/id.po
+++ b/po/id.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libc 2.9.90\n"
 "POT-Creation-Date: 2009-02-06 12:40-0800\n"
-"PO-Revision-Date: 2009-03-07 20:30+0700\n"
+"PO-Revision-Date: 2009-03-10 11:30+0700\n"
 "Last-Translator: Arif E. Nugroho <arif_endro@yahoo.com>\n"
 "Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
 "MIME-Version: 1.0\n"
@@ -43,7 +43,7 @@ msgstr "  atau: "
 
 #: argp/argp-help.c:1617
 msgid " [OPTION...]"
-msgstr " [OPSI...]"
+msgstr " [PILIHAN...]"
 
 #: argp/argp-help.c:1644
 #, c-format
@@ -287,7 +287,7 @@ msgstr "ukuran penunjuk tidak valid"
 
 #: debug/xtrace.sh:27 debug/xtrace.sh:45
 msgid "Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\\n"
-msgstr "Penggunaan: xtrace [OPSI]... APLIKASI [OPSI-APLIKASI]...\\n"
+msgstr "Penggunaan: xtrace [PILIHAN]... APLIKASI [PILIHAN APLIKASI]...\\n"
 
 #: debug/xtrace.sh:33
 msgid "Try \\`xtrace --help' for more information.\\n"
@@ -298,7 +298,6 @@ msgid "xtrace: option \\`$1' requires an argument.\\n"
 msgstr "xtrace: pilihan \\`$1' membutuhkan sebuah argumen.\\n"
 
 #: debug/xtrace.sh:46
-#, fuzzy
 msgid ""
 "Trace execution of program by printing currently executed function.\n"
 "\n"
@@ -315,6 +314,7 @@ msgstr ""
 "Telusuri jalannya aplikasi dengan menampilkan fungsi yang sedang dijalankan.\n"
 "\n"
 "     --data=BERKAS        Jangan jalankan aplikasi, hanya tampilkan data dari BERKAS.\n"
+"\n"
 "   -?,--help              Tampilkan bantuan ini dan keluar\n"
 "      --usage             Berikan sebuah pesan pendek penggunaan\n"
 "   -V,--version           Tampilkan informasi versi dan keluar\n"
@@ -322,8 +322,6 @@ msgstr ""
 "Argumen wajib untuk pilihan panjang juga wajib untuk setiap pilihan pendek\n"
 "yang berhubungan.\n"
 "\n"
-"Untuk instruksi pelaporan bug, mohon lihat:\n"
-"<http://www.gnu.org/software/libc/bugs.html>.\\n"
 
 #: debug/xtrace.sh:127
 msgid "xtrace: unrecognized option \\`$1'\\n"
@@ -910,7 +908,6 @@ msgid "Written by %s and %s.\n"
 msgstr "Ditulis oleh %s dan %s.\n"
 
 #: elf/ldd.bash.in:48
-#, fuzzy
 msgid ""
 "Usage: ldd [OPTION]... FILE...\n"
 "      --help              print this help and exit\n"
@@ -920,15 +917,13 @@ msgid ""
 "  -u, --unused            print unused direct dependencies\n"
 "  -v, --verbose           print all information\n"
 msgstr ""
-"Penggunaan: ldd [OPSI... BERKAS...\n"
+"Penggunaan: ldd [PILIHAN... BERKAS...\n"
 "      --help              tampilkan bantuan ini dan keluar\n"
 "      --version           tampilkan informasi versi dan keluar\n"
 "  -d, --data-relocs       proses relokasi data\n"
 "  -r, --function-relocs   proses data dan relokasi fungsi\n"
 "  -u, --unused            tampilkan tidak digunakan ketergantungan langsung\n"
 "  -v, --verbose           tampilkan seluruh informasi\n"
-"Untuk instruksi pelaporan bug, mohon lihat:\n"
-"<http://www.gnu.org/software/libc/bugs.html>."
 
 #: elf/ldd.bash.in:82
 msgid "ldd: option \\`$1' is ambiguous"
@@ -1085,7 +1080,7 @@ msgstr "hasilkan call graph"
 
 #: elf/sprof.c:89
 msgid "Read and display shared object profiling data."
-msgstr ""
+msgstr "Baca dan tampilkan data profiling objek terbagi."
 
 #: elf/sprof.c:94
 msgid "SHOBJ [PROFDATA]"
@@ -2828,7 +2823,6 @@ msgid "memusage: option \\`$1' requires an argument"
 msgstr "memusage: pilihan \\`$1' membutuhkan sebuah argumen"
 
 #: malloc/memusage.sh:39
-#, fuzzy
 msgid ""
 "Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]...\n"
 "Profile memory usage of PROGRAM.\n"
@@ -2856,7 +2850,7 @@ msgid ""
 "short options.\n"
 "\n"
 msgstr ""
-"Penggunaan: memusage [OPSI]... APLIKASI [OPSIAPLIKASI]...\n"
+"Penggunaan: memusage [PILIHAN]... APLIKASI [PILIHAN APLIKASI]...\n"
 "Profile penggunaan memori dari APLIKASI.\n"
 "\n"
 "   -n,--progname=NAMA     Nama dari berkas aplikasi ke profile\n"
@@ -2880,8 +2874,6 @@ msgstr ""
 "Argumen wajib untuk pilihan panjang juga wajib untuk setiap pilihan pendek\n"
 "yang berhubungan.\n"
 "\n"
-"Untuk instruksi pelaporan bug, mohon lihat:\n"
-"<http://www.gnu.org/software/libc/bugs.html>."
 
 #: malloc/memusage.sh:101
 msgid ""
@@ -2893,7 +2885,7 @@ msgstr ""
 "Sintaks: memusage [--data=BERKAS] [--progname=NAMA] [--png=BERKAS] [--unbuffered]\n"
 "            [--buffer=UKURAN] [--no-timer] [--time-based] [--total]\n"
 "            [--title=STRING] [--x-size=UKURAN] [--y-size=UKURAN]\n"
-"            APLIKASI [OPSIAPLIKASI]..."
+"            APLIKASI [PILIHAN APLIKASI]..."
 
 #: malloc/memusage.sh:193
 msgid "memusage: option \\`${1##*=}' is ambiguous"
@@ -3708,16 +3700,16 @@ msgstr "tidak dapat menangani versi permintaan lama %d; versi sekarang adalah %d
 #: nscd/connections.c:1077
 #, c-format
 msgid "request from %ld not handled due to missing permission"
-msgstr ""
+msgstr "permintaan dari %ld tidak dapat ditangani karena tidak ada ijin"
 
 #: nscd/connections.c:1082
 #, c-format
 msgid "request from '%s' [%ld] not handled due to missing permission"
-msgstr ""
+msgstr "permintaan dari '%s' [%ld] tidak dapat ditangani karena tidak ada ijin"
 
 #: nscd/connections.c:1087
 msgid "request not handled due to missing permission"
-msgstr ""
+msgstr "permintaan tidak dapat ditangani karena tidak ada ijin"
 
 #: nscd/connections.c:1125 nscd/connections.c:1178
 #, c-format
@@ -3792,7 +3784,7 @@ msgstr "handle_request: permintaan diterima (Versi = %d)"
 #: nscd/connections.c:1903 nscd/connections.c:2101
 #, c-format
 msgid "disabled inotify after read error %d"
-msgstr ""
+msgstr "menonaktifkan inotify setelah error membaca %d"
 
 #: nscd/connections.c:2230
 msgid "could not initialize conditional variable"
@@ -4220,7 +4212,7 @@ msgstr "Error memperoleh sid dari konteks"
 
 #: nscd/selinux.c:374
 msgid "compile-time support for database policy missing"
-msgstr ""
+msgstr "dukungan waktu-kompilasi untuk kebijakan basis data tidak ada"
 
 #: nscd/selinux.c:407
 #, c-format
@@ -4269,7 +4261,7 @@ msgstr "Konfigurasi layanan yang akan digunakan"
 
 #: nss/getent.c:62
 msgid "Get entries from administrative database."
-msgstr ""
+msgstr "Dapatkan masukan dari basis data administrasi."
 
 #: nss/getent.c:143 nss/getent.c:408
 #, c-format
@@ -4370,6 +4362,13 @@ msgid ""
 "environment SPEC.\n"
 "\n"
 msgstr ""
+"Penggunaan: getconf [-v SPEK] VAR\n"
+"      atau: getconf [-v SPEK] VAR_JALUR JALUR\n"
+"\n"
+"Dapatkan nilai konfigurasi untuk variabel VAR, atau untuk variabel VAR_JALUR\n"
+"untuk jalur PATH. Jika SPEK diberikan, berikan nilai untuk kompilasi\n"
+"lingkungan SPEK.\n"
+"\n"
 
 #: posix/getconf.c:1081
 #, c-format
@@ -4880,82 +4879,82 @@ msgstr "\t%s [-n netid]* [-o outfile] [infile]\n"
 #: sunrpc/rpc_main.c:1469
 #, c-format
 msgid "options:\n"
-msgstr ""
+msgstr "pilihan:\n"
 
 #: sunrpc/rpc_main.c:1470
 #, c-format
 msgid "-a\t\tgenerate all files, including samples\n"
-msgstr ""
+msgstr "-a\t\tbuat seluruh berkas, termasuk contoh\n"
 
 #: sunrpc/rpc_main.c:1471
 #, c-format
 msgid "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n"
-msgstr ""
+msgstr "-b\t\tmode kompabilitas kebelakang (buat kode untuk SunOS 4.1)\n"
 
 #: sunrpc/rpc_main.c:1472
 #, c-format
 msgid "-c\t\tgenerate XDR routines\n"
-msgstr ""
+msgstr "-c\t\tbuat rutinitas XDR\n"
 
 #: sunrpc/rpc_main.c:1473
 #, c-format
 msgid "-C\t\tANSI C mode\n"
-msgstr ""
+msgstr "-C\t\tmode ANSI C\n"
 
 #: sunrpc/rpc_main.c:1474
 #, c-format
 msgid "-Dname[=value]\tdefine a symbol (same as #define)\n"
-msgstr ""
+msgstr "-Dnama[=nilai]\tdefinisikan sebuah simbol (sama seperti #define)\n"
 
 #: sunrpc/rpc_main.c:1475
 #, c-format
 msgid "-h\t\tgenerate header file\n"
-msgstr ""
+msgstr "-h\t\thasilkan berkas kepala\n"
 
 #: sunrpc/rpc_main.c:1476
 #, c-format
 msgid "-i size\t\tsize at which to start generating inline code\n"
-msgstr ""
+msgstr "-i ukuran\t\tukuran dimana untuk memulai kodee inline\n"
 
 #: sunrpc/rpc_main.c:1477
 #, c-format
 msgid "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n"
-msgstr ""
+msgstr "-I\t\thasilkan kode untuk dukungan inetd dalam server (untuk SunOS 4.1)\n"
 
 #: sunrpc/rpc_main.c:1478
 #, c-format
 msgid "-K seconds\tserver exits after K seconds of inactivity\n"
-msgstr ""
+msgstr "-K detik\tserver keluar setelah K detik untuk istirahat\n"
 
 #: sunrpc/rpc_main.c:1479
 #, c-format
 msgid "-l\t\tgenerate client side stubs\n"
-msgstr ""
+msgstr "-l\t\tbuat stubs sisi klien\n"
 
 #: sunrpc/rpc_main.c:1480
 #, c-format
 msgid "-L\t\tserver errors will be printed to syslog\n"
-msgstr ""
+msgstr "-L\t\terror server akan ditampilkan ke sistem pencatatan\n"
 
 #: sunrpc/rpc_main.c:1481
 #, c-format
 msgid "-m\t\tgenerate server side stubs\n"
-msgstr ""
+msgstr "-m\t\tbuat stubs sisi server\n"
 
 #: sunrpc/rpc_main.c:1482
 #, c-format
 msgid "-M\t\tgenerate MT-safe code\n"
-msgstr ""
+msgstr "-M\t\thasilkan kode MT-safe\n"
 
 #: sunrpc/rpc_main.c:1483
 #, c-format
 msgid "-n netid\tgenerate server code that supports named netid\n"
-msgstr ""
+msgstr "-n netid\tbuat kode server yang mendukung netid bernama\n"
 
 #: sunrpc/rpc_main.c:1484
 #, c-format
 msgid "-N\t\tsupports multiple arguments and call-by-value\n"
-msgstr ""
+msgstr "-N\t\tdukung argumen ganda dan panggil-dengan-nilai\n"
 
 #: sunrpc/rpc_main.c:1485
 #, c-format
@@ -4965,32 +4964,32 @@ msgstr "-o berkas keluar\tnama dari berkas keluaran\n"
 #: sunrpc/rpc_main.c:1486
 #, c-format
 msgid "-s nettype\tgenerate server code that supports named nettype\n"
-msgstr ""
+msgstr "-s nettype\tbuat kode server yang mendukung nettype bernama\n"
 
 #: sunrpc/rpc_main.c:1487
 #, c-format
 msgid "-Sc\t\tgenerate sample client code that uses remote procedures\n"
-msgstr ""
+msgstr "-Sc\t\tbuat contoh kode klien yang menggunakan prosedur remote\n"
 
 #: sunrpc/rpc_main.c:1488
 #, c-format
 msgid "-Ss\t\tgenerate sample server code that defines remote procedures\n"
-msgstr ""
+msgstr "-Ss\t\tbuat contoh kode server yang mendefinisikan prosedur remote\n"
 
 #: sunrpc/rpc_main.c:1489
 #, c-format
 msgid "-Sm \t\tgenerate makefile template \n"
-msgstr ""
+msgstr "-Sm \t\tbuat template makefile \n"
 
 #: sunrpc/rpc_main.c:1490
 #, c-format
 msgid "-t\t\tgenerate RPC dispatch table\n"
-msgstr ""
+msgstr "-t\t\tbuat tabel eksekusi RPC\n"
 
 #: sunrpc/rpc_main.c:1491
 #, c-format
 msgid "-T\t\tgenerate code to support RPC dispatch tables\n"
-msgstr ""
+msgstr "-T\t\tbuat kode untuk mendukung tabel eksekusi RPC\n"
 
 #: sunrpc/rpc_main.c:1492
 #, c-format
@@ -6255,6 +6254,8 @@ msgid ""
 "Usage: lddlibc4 FILE\n"
 "\n"
 msgstr ""
+"Penggunaan: lddlibc4 BERKAS\n"
+"\n"
 
 #: sysdeps/unix/sysv/linux/lddlibc4.c:82
 #, c-format
diff --git a/posix/tst-sysconf.c b/posix/tst-sysconf.c
index e9ff06a8da..e2972291ae 100644
--- a/posix/tst-sysconf.c
+++ b/posix/tst-sysconf.c
@@ -97,7 +97,7 @@ do_test (void)
 	  result = 1;
 	}
 
-#define STDVER 200112L
+#define STDVER 200809L
       if (scret > 0 && scret != STDVER && !posix_options[i].positive)
 	{
 	  printf ("sysconf(_SC_%s%s) must be %ldL\n",
diff --git a/posix/unistd.h b/posix/unistd.h
index 6876e3af31..24ec74e05e 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -30,33 +30,35 @@ __BEGIN_DECLS
 /* These may be used to determine what facilities are present at compile time.
    Their values can be obtained at run time from `sysconf'.  */
 
-/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001.  */
-#define	_POSIX_VERSION	200112L
+/* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008.  */
+#define	_POSIX_VERSION	200809L
 
 /* These are not #ifdef __USE_POSIX2 because they are
    in the theoretically application-owned namespace.  */
 
 /* The utilities on GNU systems also correspond to this version.  */
-#define _POSIX2_VERSION	200112L
+#define _POSIX2_VERSION	200809L
 
 /* If defined, the implementation supports the
    C Language Bindings Option.  */
-#define	_POSIX2_C_BIND	200112L
+#define	_POSIX2_C_BIND	200809L
 
 /* If defined, the implementation supports the
    C Language Development Utilities Option.  */
-#define	_POSIX2_C_DEV	200112L
+#define	_POSIX2_C_DEV	200809L
 
 /* If defined, the implementation supports the
    Software Development Utilities Option.  */
-#define	_POSIX2_SW_DEV	200112L
+#define	_POSIX2_SW_DEV	200809L
 
 /* If defined, the implementation supports the
    creation of locales with the localedef utility.  */
-#define _POSIX2_LOCALEDEF       200112L
+#define _POSIX2_LOCALEDEF       200809L
 
 /* X/Open version number to which the library conforms.  It is selectable.  */
-#ifdef __USE_XOPEN2K
+#ifdef __USE_XOPEN2K8
+# define _XOPEN_VERSION	700
+#elif defined __USE_XOPEN2K
 # define _XOPEN_VERSION	600
 #elif defined __USE_UNIX98
 # define _XOPEN_VERSION	500
diff --git a/stdlib/at_quick_exit.c b/stdlib/at_quick_exit.c
index abe2910a7b..1d37e1c2eb 100644
--- a/stdlib/at_quick_exit.c
+++ b/stdlib/at_quick_exit.c
@@ -43,6 +43,7 @@ extern void *__dso_handle __attribute__ ((__weak__));
 
 /* Register FUNC to be executed by `quick_exit'.  */
 int
+attribute_hidden
 at_quick_exit (void (*func) (void))
 {
   return __cxa_at_quick_exit ((void (*) (void *)) func,
diff --git a/stdlib/cxa_at_quick_exit.c b/stdlib/cxa_at_quick_exit.c
index 45c5f5e84c..2c6d688462 100644
--- a/stdlib/cxa_at_quick_exit.c
+++ b/stdlib/cxa_at_quick_exit.c
@@ -25,7 +25,6 @@ struct exit_function_list *__quick_exit_funcs = &initial_quick;
 
 /* Register a function to be called by quick_exit.  */
 int
-attribute_hidden
 __cxa_at_quick_exit (void (*func) (void *), void *d)
 {
   return __internal_atexit (func, NULL, d, &__quick_exit_funcs);
diff --git a/stdlib/exit.c b/stdlib/exit.c
index 539ae4bd7e..2235990285 100644
--- a/stdlib/exit.c
+++ b/stdlib/exit.c
@@ -97,6 +97,6 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
 void
 exit (int status)
 {
-  __run_exit_handlers (status, __exit_funcs, true);
+  __run_exit_handlers (status, &__exit_funcs, true);
 }
 libc_hidden_def (exit)
diff --git a/stdlib/exit.h b/stdlib/exit.h
index 948948d19b..d5013218a6 100644
--- a/stdlib/exit.h
+++ b/stdlib/exit.h
@@ -66,13 +66,13 @@ extern struct exit_function *__new_exitfn (struct exit_function_list **listp);
 extern uint64_t __new_exitfn_called attribute_hidden;
 
 extern void __run_exit_handlers (int status, struct exit_function_list **listp,
-				 bool run_list_atexit) attribute_hidden;
+				 bool run_list_atexit)
+  attribute_hidden __attribute__ ((__noreturn__));
 
 extern int __internal_atexit (void (*func) (void *), void *arg, void *d,
 			      struct exit_function_list **listp)
   attribute_hidden;
-extern int __cxa_at_quick_exit (void (*func) (void *), void *d)
-  attribute_hidden;
+extern int __cxa_at_quick_exit (void (*func) (void *), void *d);
 
 
 #endif	/* exit.h  */
diff --git a/stdlib/quick_exit.c b/stdlib/quick_exit.c
index 20cb409b7d..d6306240c4 100644
--- a/stdlib/quick_exit.c
+++ b/stdlib/quick_exit.c
@@ -26,5 +26,5 @@
 void
 quick_exit (int status)
 {
-  __run_exit_handlers (status, __quick_exit_funcs, false);
+  __run_exit_handlers (status, &__quick_exit_funcs, false);
 }
diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
index c70f85130d..0a4a57da68 100644
--- a/sysdeps/powerpc/fpu/fenv_libc.h
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
@@ -1,5 +1,5 @@
 /* Internal libc stuff for floating point environment routines.
-   Copyright (C) 1997, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2006, 2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -39,7 +39,10 @@ libm_hidden_proto (__fe_nomask_env)
 	do { \
 	  double d = (env); \
 	  if(GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
-	    asm volatile ("mtfsf 0xff,%0,1,0" : : "f" (d)); \
+	    asm volatile (".machine push; " \
+			  ".machine \"power6\"; " \
+			  "mtfsf 0xff,%0,1,0; " \
+			  ".machine pop" : : "f" (d)); \
 	  else \
 	    asm volatile ("mtfsf 0xff,%0" : : "f" (d)); \
 	} while(0)
@@ -52,8 +55,9 @@ libm_hidden_proto (__fe_nomask_env)
    functions.  */
 #define relax_fenv_state() \
 	do { \
-	   if(GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
-	       asm ("mtfsfi 7,0,1"); \
+	   if (GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
+	     asm (".machine push; .machine \"power6\"; " \
+		  "mtfsfi 7,0,1; .machine pop"); \
 	   asm ("mtfsfi 7,0"); \
 	} while(0)
 
diff --git a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
index a15fe86fb9..e75a7f1941 100644
--- a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
+++ b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
@@ -111,7 +111,11 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
     tmp __attribute__ ((__aligned__(8)));				     \
   tmp.fpscr = __fpscr;							     \
   /* Set the entire 64-bit FPSCR.  */					     \
-  __asm__ ("lfd%U0 0,%0; mtfsf 255,0,1,0" : : "m" (tmp.d) : "fr0");	     \
+  __asm__ ("lfd%U0 0,%0; "						     \
+	   ".machine push; "						     \
+	   ".machine \"power6\"; "					     \
+	   "mtfsf 255,0,1,0; "						     \
+	   ".machine pop" : : "m" (tmp.d) : "fr0");			     \
   tmp.d = 0;								     \
   __asm__("lfd%U0 0,%0" : : "m" (tmp.d) : "fr0");			     \
 }
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index d83a0ef28d..127c9e4581 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -204,6 +204,8 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* Use the extended four-operand version of the mtfsf insn.  */
 	mtfsf	0xff,fp31,1,0
 # else
+	.machine push
+	.machine "power6"
 	/* Availability of DFP indicates a 64-bit FPSCR.  */
 	andi.	r6,r7,PPC_FEATURE_HAS_DFP
 	beq	7f
@@ -212,7 +214,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	b	8f
 	/* Continue to operate on the FPSCR as if it were 32-bits.  */
 7:	mtfsf	0xff,fp31
-8:
+8:	.machine pop
 # endif /* _ARCH_PWR6 */
 	lfd	fp1,_UC_FREGS+(1*8)(r31)
 	lfd	fp2,_UC_FREGS+(2*8)(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 243a66a0d4..89b1a61954 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -430,6 +430,8 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* Use the extended four-operand version of the mtfsf insn.  */
 	mtfsf	0xff,fp31,1,0
 # else
+	.machine push
+	.machine "power6"
 	/* Availability of DFP indicates a 64-bit FPSCR.  */
 	andi.	r6,r7,PPC_FEATURE_HAS_DFP
 	beq	7f
@@ -438,7 +440,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	b	8f
 	/* Continue to operate on the FPSCR as if it were 32-bits.  */
 7:	mtfsf	0xff,fp31
-8:
+8:	.machine pop
 #endif /* _ARCH_PWR6 */
 	lfd	fp1,_UC_FREGS+(1*8)(r31)
 	lfd	fp2,_UC_FREGS+(2*8)(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
index b4e28b4813..24413e00bc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -1,5 +1,6 @@
 /* Switch to context.
-   Copyright (C) 2002, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2008, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -86,6 +87,8 @@ ENTRY(__novec_setcontext)
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r5,PPC_FEATURE_HAS_DFP
   beq    5f
@@ -96,6 +99,7 @@ ENTRY(__novec_setcontext)
 5:
   mtfsf  0xff,fp0
 6:
+  .machine pop
 # endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
@@ -374,6 +378,8 @@ L(has_no_vec):
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r5,PPC_FEATURE_HAS_DFP
   beq    7f
@@ -384,6 +390,7 @@ L(has_no_vec):
 7:
   mtfsf  0xff,fp0
 8:
+  .machine pop
 # endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
index c42ccfbe44..6c075a9a35 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
@@ -1,5 +1,6 @@
 /* Save current context and install the given one.
-   Copyright (C) 2002, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2008, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -180,6 +181,8 @@ ENTRY(__novec_swapcontext)
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r8,PPC_FEATURE_HAS_DFP
   beq    5f
@@ -190,6 +193,7 @@ ENTRY(__novec_swapcontext)
 5:
   mtfsf  0xff,fp0
 6:
+  .machine pop
 #endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
@@ -672,6 +676,8 @@ L(has_no_vec2):
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r8,PPC_FEATURE_HAS_DFP
   beq    7f
@@ -682,6 +688,7 @@ L(has_no_vec2):
 7:
   mtfsf  0xff,fp0
 8:
+  .machine pop
 #endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
diff --git a/time/tst-posixtz.c b/time/tst-posixtz.c
index ccba63e5b4..019d92ada0 100644
--- a/time/tst-posixtz.c
+++ b/time/tst-posixtz.c
@@ -18,6 +18,10 @@ struct
     "1999/02/26 07:18:12 dst=1 zone=AEDST" },
   { 909312849L, "EST+5EDT,M4.1.0/2,M10.5.0/2",
     "1998/10/25 05:54:09 dst=0 zone=EST" },
+  { 909312849L, "EST5EDT,M4.1.0/2,M10.5.0/2",
+    "1998/10/25 05:54:09 dst=0 zone=EST" },
+  { 909312849L, "<EST5>5EDT,M4.1.0/2,M10.5.0/2",
+    "1998/10/25 05:54:09 dst=0 zone=EST5" },
   { 924864849L, "EST+5EDT,M4.1.0/2,M10.5.0/2",
     "1999/04/23 06:54:09 dst=1 zone=EDT" },
   { 919973892L, "EST+5EDT,M4.1.0/2,M10.5.0/2",
@@ -84,5 +88,31 @@ main (void)
       puts (", FAIL");
     }
 
+  setenv ("TZ", "<AB1>-10<AB2>-11,M10.5.0,M3.5.0", 1);
+  tzset ();
+  printf ("TZ = \"<AB1>-10<AB2>-11,M10.5.0,M3.5.0\" daylight %d"
+	  " tzname = { \"%s\", \"%s\" }", daylight, tzname[0], tzname[1]);
+  if (daylight
+      && strcmp (tzname[0], "AB1") == 0 && strcmp (tzname[1], "AB2") == 0)
+    puts (", OK");
+  else
+    {
+      result = 1;
+      puts (", FAIL");
+    }
+
+  setenv ("TZ", "<BB1>-10", 1);
+  tzset ();
+  printf ("TZ = \"<BB1>-10\" daylight %d"
+	  " tzname = { \"%s\", \"%s\" }", daylight, tzname[0], tzname[1]);
+  if (daylight == 0
+      && strcmp (tzname[0], "BB1") == 0 && strcmp (tzname[1], "BB1") == 0)
+    puts (", OK");
+  else
+    {
+      result = 1;
+      puts (", FAIL");
+    }
+
   return result;
 }
diff --git a/time/tzset.c b/time/tzset.c
index 5cde0bfbd5..b87578fe48 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -157,40 +157,47 @@ update_vars (void)
     __tzname_cur_max = len1;
 }
 
+
+static unsigned int
+__attribute_noinline__
+compute_offset (unsigned int ss, unsigned int mm, unsigned int hh)
+{
+  return min (ss, 59) + min (mm, 59) * 60 + min (hh, 24) * 60 * 60;
+}
+
+
 /* Parse the POSIX TZ-style string.  */
 void
 __tzset_parse_tz (tz)
      const char *tz;
 {
-  register size_t l;
-  char *tzbuf;
   unsigned short int hh, mm, ss;
-  unsigned short int whichrule;
 
   /* Clear out old state and reset to unnamed UTC.  */
-  memset (tz_rules, 0, sizeof tz_rules);
+  memset (tz_rules, '\0', sizeof tz_rules);
   tz_rules[0].name = tz_rules[1].name = "";
 
   /* Get the standard timezone name.  */
-  tzbuf = strdupa (tz);
+  char *tzbuf = strdupa (tz);
 
-  if (sscanf (tz, "%[A-Za-z]", tzbuf) != 1)
+  int consumed;
+  if (sscanf (tz, "%[A-Za-z]%n", tzbuf, &consumed) != 1)
     {
       /* Check for the quoted version.  */
       char *wp = tzbuf;
-      if (*tz++ != '<')
+      if (__builtin_expect (*tz++ != '<', 0))
 	goto out;
 
       while (isalnum (*tz) || *tz == '+' || *tz == '-')
 	*wp++ = *tz++;
-      if (*tz++ != '>' || wp - tzbuf < 3)
+      if (__builtin_expect (*tz++ != '>' || wp - tzbuf < 3, 0))
 	goto out;
       *wp = '\0';
     }
-  else if ((l = strlen (tzbuf)) < 3)
+  else if (__builtin_expect (consumed < 3, 0))
     goto out;
   else
-    tz += l;
+    tz += consumed;
 
   tz_rules[0].name = __tzstring (tzbuf);
 
@@ -202,7 +209,8 @@ __tzset_parse_tz (tz)
     tz_rules[0].offset = *tz++ == '-' ? 1L : -1L;
   else
     tz_rules[0].offset = -1L;
-  switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
+  switch (sscanf (tz, "%hu%n:%hu%n:%hu%n",
+		  &hh, &consumed, &mm, &consumed, &ss, &consumed))
     {
     default:
       tz_rules[0].offset = 0;
@@ -214,46 +222,36 @@ __tzset_parse_tz (tz)
     case 3:
       break;
     }
-  tz_rules[0].offset *= (min (ss, 59) + (min (mm, 59) * 60) +
-			 (min (hh, 24) * 60 * 60));
-
-  for (l = 0; l < 3; ++l)
-    {
-      while (isdigit(*tz))
-	++tz;
-      if (l < 2 && *tz == ':')
-	++tz;
-    }
+  tz_rules[0].offset *= compute_offset (ss, mm, hh);
+  tz += consumed;
 
   /* Get the DST timezone name (if any).  */
   if (*tz != '\0')
     {
-      char *n = tzbuf + strlen (tzbuf) + 1;
-
-      if (sscanf (tz, "%[A-Za-z]", tzbuf) != 1)
+      if (sscanf (tz, "%[A-Za-z]%n", tzbuf, &consumed) != 1)
 	{
 	  /* Check for the quoted version.  */
 	  char *wp = tzbuf;
 	  const char *rp = tz;
-	  if (*rp++ != '<')
+	  if (__builtin_expect (*rp++ != '<', 0))
 	    /* Punt on name, set up the offsets.  */
 	    goto done_names;
 
 	  while (isalnum (*rp) || *rp == '+' || *rp == '-')
 	    *wp++ = *rp++;
-	  if (*rp++ != '>' || wp - tzbuf < 3)
+	  if (__builtin_expect (*rp++ != '>' || wp - tzbuf < 3, 0))
 	    /* Punt on name, set up the offsets.  */
 	    goto done_names;
 	  *wp = '\0';
 	  tz = rp;
 	}
-      else if ((l = strlen (tzbuf)) < 3)
+      else if (__builtin_expect (consumed < 3, 0))
 	/* Punt on name, set up the offsets.  */
 	goto done_names;
       else
-	tz += l;
+	tz += consumed;
 
-      tz_rules[1].name = __tzstring (n);
+      tz_rules[1].name = __tzstring (tzbuf);
 
       /* Figure out the DST offset from GMT.  */
       if (*tz == '-' || *tz == '+')
@@ -261,7 +259,8 @@ __tzset_parse_tz (tz)
       else
 	tz_rules[1].offset = -1L;
 
-      switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
+      switch (sscanf (tz, "%hu%n:%hu%n:%hu%n",
+		      &hh, &consumed, &mm, &consumed, &ss, &consumed))
 	{
 	default:
 	  /* Default to one hour later than standard time.  */
@@ -273,17 +272,10 @@ __tzset_parse_tz (tz)
 	case 2:
 	  ss = 0;
 	case 3:
-	  tz_rules[1].offset *= (min (ss, 59) + (min (mm, 59) * 60) +
-				 (min (hh, 24) * (60 * 60)));
+	  tz_rules[1].offset *= compute_offset (ss, mm, hh);
+	  tz += consumed;
 	  break;
 	}
-      for (l = 0; l < 3; ++l)
-	{
-	  while (isdigit (*tz))
-	    ++tz;
-	  if (l < 2 && *tz == ':')
-	    ++tz;
-	}
       if (*tz == '\0' || (tz[0] == ',' && tz[1] == '\0'))
 	{
 	  /* There is no rule.  See if there is a default rule file.  */
@@ -307,7 +299,7 @@ __tzset_parse_tz (tz)
 
  done_names:
   /* Figure out the standard <-> DST rules.  */
-  for (whichrule = 0; whichrule < 2; ++whichrule)
+  for (unsigned int whichrule = 0; whichrule < 2; ++whichrule)
     {
       register tz_rule *tzr = &tz_rules[whichrule];
 
@@ -322,23 +314,23 @@ __tzset_parse_tz (tz)
 	  tzr->type = *tz == 'J' ? J1 : J0;
 	  if (tzr->type == J1 && !isdigit (*++tz))
 	    goto out;
-	  tzr->d = (unsigned short int) strtoul (tz, &end, 10);
-	  if (end == tz || tzr->d > 365)
+	  unsigned long int d = strtoul (tz, &end, 10);
+	  if (end == tz || d > 365)
 	    goto out;
-	  else if (tzr->type == J1 && tzr->d == 0)
+	  if (tzr->type == J1 && d == 0)
 	    goto out;
+	  tzr->d = d;
 	  tz = end;
 	}
       else if (*tz == 'M')
 	{
-	  int n;
 	  tzr->type = M;
 	  if (sscanf (tz, "M%hu.%hu.%hu%n",
-		      &tzr->m, &tzr->n, &tzr->d, &n) != 3 ||
-	      tzr->m < 1 || tzr->m > 12 ||
-	      tzr->n < 1 || tzr->n > 5 || tzr->d > 6)
+		      &tzr->m, &tzr->n, &tzr->d, &consumed) != 3
+	      || tzr->m < 1 || tzr->m > 12
+	      || tzr->n < 1 || tzr->n > 5 || tzr->d > 6)
 	    goto out;
-	  tz += n;
+	  tz += consumed;
 	}
       else if (*tz == '\0')
 	{
@@ -368,7 +360,9 @@ __tzset_parse_tz (tz)
 	  ++tz;
 	  if (*tz == '\0')
 	    goto out;
-	  switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
+	  consumed = 0;
+	  switch (sscanf (tz, "%hu%n:%hu%n:%hu%n",
+			  &hh, &consumed, &mm, &consumed, &ss, &consumed))
 	    {
 	    default:
 	      hh = 2;		/* Default to 2:00 AM.  */
@@ -379,13 +373,7 @@ __tzset_parse_tz (tz)
 	    case 3:
 	      break;
 	    }
-	  for (l = 0; l < 3; ++l)
-	    {
-	      while (isdigit (*tz))
-		++tz;
-	      if (l < 2 && *tz == ':')
-		++tz;
-	    }
+	  tz += consumed;
 	  tzr->secs = (hh * 60 * 60) + (mm * 60) + ss;
 	}
       else
@@ -457,14 +445,11 @@ tzset_internal (always, explicit)
   if (tz == NULL || *tz == '\0'
       || (TZDEFAULT != NULL && strcmp (tz, TZDEFAULT) == 0))
     {
+      memset (tz_rules, '\0', sizeof tz_rules);
       tz_rules[0].name = tz_rules[1].name = "UTC";
-      tz_rules[0].type = tz_rules[1].type = J0;
-      tz_rules[0].m = tz_rules[0].n = tz_rules[0].d = 0;
-      tz_rules[1].m = tz_rules[1].n = tz_rules[1].d = 0;
-      tz_rules[0].secs = tz_rules[1].secs = 0;
-      tz_rules[0].offset = tz_rules[1].offset = 0L;
+      if (J0 != 0)
+	tz_rules[0].type = tz_rules[1].type = J0;
       tz_rules[0].change = tz_rules[1].change = (time_t) -1;
-      tz_rules[0].computed_for = tz_rules[1].computed_for = 0;
       update_vars ();
       return;
     }