From 1cb6b555a864f401c8a2ba75814e982b66a62971 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 3 Jul 2008 12:21:19 +0000 Subject: Updated to fedora-glibc-20080703T1203 --- ChangeLog | 73 +++++++++++ configure | 2 +- configure.in | 2 +- fedora/branch.mk | 4 +- fedora/glibc.spec.in | 7 +- hurd/fd-read.c | 1 + hurd/get-host.c | 1 + hurd/hurd/fd.h | 13 ++ localedata/ChangeLog | 20 +++ localedata/locales/es_CR | 2 + localedata/locales/fi_FI | 8 +- localedata/locales/iso14651_t1_common | 226 ++++++++++++++++++++++++++++++++++ localedata/tst-strptime.c | 35 +++++- nscd/connections.c | 32 ++++- posix/tst-regex.c | 20 +-- resolv/res_debug.c | 1 + stdlib/canonicalize.c | 4 +- stdlib/tst-setcontext.c | 5 +- sysdeps/mach/hurd/dl-sysdep.c | 1 + sysdeps/mach/hurd/recv.c | 4 +- sysdeps/mach/hurd/recvfrom.c | 6 +- sysdeps/mach/hurd/recvmsg.c | 6 +- sysdeps/mach/hurd/send.c | 2 +- sysdeps/mach/hurd/sendmsg.c | 2 +- sysdeps/mach/hurd/sendto.c | 2 +- sysdeps/posix/getaddrinfo.c | 30 ++--- sysdeps/unix/bsd/bsd4.4/bits/socket.h | 4 +- time/strptime_l.c | 14 +-- 28 files changed, 454 insertions(+), 73 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b01c4a45c..7edad286e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,76 @@ +2008-07-01 Samuel Thibault + + * sysdeps/unix/bsd/bsd4.4/bits/socket.h: Define MSG_NOSIGNAL. + * hurd/hurd/fd.h (__hurd_sockfail): Add extern inline function. + * sysdeps/mach/hurd/recv.c (__recv): Use __hurd_sockfail instead of + __hurd_dfail. + * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise. + * sysdeps/mach/hurd/recvmsg.c (__recvmsg): Likewise. + * sysdeps/mach/hurd/send.c (__send): Likewise. + * sysdeps/mach/hurd/sendto.c (__sendfrom): Likewise. + * sysdeps/mach/hurd/sendmsg.c (__sendmsg): Likewise. + +2008-03-04 Samuel Thibault + + * sysdeps/mach/hurd/recv.c (__recv): Initialize NPORTS. + * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise. + * sysdeps/mach/hurd/recvmsg.c (__recvmsg): Likewise. + * hurd/fd-read.c (_hurd_fd_read): Initialize NREAD. + * hurd/get-host.c (_hurd_get_host_config): Likewise. + * sysdeps/mach/hurd/dl-sysdep.c (__libc_read): Likewise. + +2008-06-27 Ulrich Drepper + + [BZ #6657] + * time/strptime_l.c: Don't clear s.era_cnt after successful match + of %EY. + Patch by Petr Baudis. + +2008-06-26 Ulrich Drepper + + * resolv/res_debug.c (__p_type_syms): Add ns_t_dname entry. + Patch by Peter Jones . + +2008-06-25 Ulrich Drepper + + [BZ #6654] + * stdlib/canonicalize.c (__realpath): readlink can write too much + into the buffer on platforms without PATH_MAX. + +2008-06-17 Carlos O'Donell + + [BZ #6653] + * posix/tst-regex.c (main): Rename to... + (do_test): ... this. Remove cmdline option processing. + (TIMEOUT): Define. + (TEST_FUNCTION): Define. + (CMDLINE_OPTIONS): Define. + +2008-06-25 Ulrich Drepper + + [BZ #5210] + * configure.in: Add -Werror to -fstack-protector test to catch + unsupported architectures. + Patch by Gilles Esponasse . + +2008-06-17 Joseph Myers + + * stdlib/tst-setcontext.c: Set back_in_main before exit if + getcontext returns ENOSYS. + +2008-06-18 Ulrich Drepper + + * nscd/connections.c (main_loop_poll): Fix test for read error. + (main_loop_epoll): Likewise. + +2008-06-13 Ulrich Drepper + + * sysdeps/posix/getaddrinfo.c: Move _res_hconf_init call to a + better place so it is not called when nscd is used. + + * nscd/connections.c: Also recognize and handle changes to the + resolver configuration file. + 2008-06-12 Ulrich Drepper * time/strftime.c: Pass reference to tzset_called around to handle diff --git a/configure b/configure index a43f850f51..6ffe5e64da 100755 --- a/configure +++ b/configure @@ -6451,7 +6451,7 @@ else int foo; main () { return 0;} EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fstack-protector +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector -o conftest conftest.c 1>&5' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 diff --git a/configure.in b/configure.in index ef9893c800..cd08a23e29 100644 --- a/configure.in +++ b/configure.in @@ -1638,7 +1638,7 @@ cat > conftest.c <&AS_MESSAGE_LOG_FD]) then libc_cv_ssp=yes diff --git a/fedora/branch.mk b/fedora/branch.mk index b4011fcac2..ab0528fd81 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 := 2008-06-13 16:01 UTC -fedora-sync-tag := fedora-glibc-20080613T1601 +fedora-sync-date := 2008-07-03 12:03 UTC +fedora-sync-tag := fedora-glibc-20080703T1203 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index c7b2d20112..f84d8f49ad 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: 7 +Release: 8 # 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 @@ -976,6 +976,11 @@ rm -f *.filelist* %endif %changelog +* Thu Jul 3 2008 Jakub Jelinek 2.8.90-8 +- update from trunk + - watch even resolv.conf in nscd using inotify + - some nscd fixes + * Fri Jun 13 2008 Jakub Jelinek 2.8.90-7 - update from trunk - avoid *lround* on ppc* clobbering cr3/cr4 registers (#450790) diff --git a/hurd/fd-read.c b/hurd/fd-read.c index 55dbc24e93..388a4dbaf9 100644 --- a/hurd/fd-read.c +++ b/hurd/fd-read.c @@ -35,6 +35,7 @@ _hurd_fd_read (struct hurd_fd *fd, void *buf, size_t *nbytes, loff_t offset) } data = buf; + nread = *nbytes; if (err = HURD_FD_PORT_USE (fd, _hurd_ctty_input (port, ctty, readfd))) return err; diff --git a/hurd/get-host.c b/hurd/get-host.c index bebad892cf..3fe0b3ef78 100644 --- a/hurd/get-host.c +++ b/hurd/get-host.c @@ -51,6 +51,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen) } data = buf; + nread = buflen; err = __io_read (config, &data, &nread, -1, buflen); if (! err) /* Check if there is more in the file we didn't read. */ diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h index 08d4407e88..d1aa867cbf 100644 --- a/hurd/hurd/fd.h +++ b/hurd/hurd/fd.h @@ -27,6 +27,7 @@ #include #include +#include /* Structure representing a file descriptor. */ @@ -179,6 +180,18 @@ __hurd_dfail (int fd, error_t err) errno = _hurd_fd_error (fd, err); return -1; } + +/* Likewise, but do not raise SIGPIPE on EPIPE if flags contain + MSG_NOSIGNAL. */ + +_HURD_FD_H_EXTERN_INLINE int +__hurd_sockfail (int fd, int flags, error_t err) +{ + if (!(flags & MSG_NOSIGNAL) || err != EPIPE) + err = _hurd_fd_error (fd, err); + errno = err; + return -1; +} /* Set up *FD to have PORT its server port, doing appropriate ctty magic. Does no locking or unlocking. */ diff --git a/localedata/ChangeLog b/localedata/ChangeLog index b446ad4361..a7291beec9 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,23 @@ +2008-06-27 Ulrich Drepper + + * tst-strptime.c (do_test): Add test of %EY. + +2008-06-25 Ulrich Drepper + + * tst-strptime.c (do_test): Add test for parsing era year + representation. + + [BZ #5911] + * locales/es_CR: Define first_weekday and first_workday. + + [BZ #5814] + * locales/fi_FI: Fix separator for hours, minutes, and seconds. + +2008-06-24 Ulrich Drepper + + * locales/iso14651_t1_common: Add support for Gurumukhi script. + Patch by Pravin Satpute . + 2008-05-21 Ulrich Drepper * locales/iso14651_t1_common: Remove U0C0D entry added for Telugu. diff --git a/localedata/locales/es_CR b/localedata/locales/es_CR index 753b22b055..d582a20d9b 100644 --- a/localedata/locales/es_CR +++ b/localedata/locales/es_CR @@ -113,6 +113,8 @@ t_fmt_ampm "/ / " +first_weekday 1 +first_workday 2 END LC_TIME LC_PAPER diff --git a/localedata/locales/fi_FI b/localedata/locales/fi_FI index 9ffe8f103e..a7920acb13 100644 --- a/localedata/locales/fi_FI +++ b/localedata/locales/fi_FI @@ -193,13 +193,15 @@ mon "";/ "";/ "" d_t_fmt "/ -" +/ +" d_fmt "" -t_fmt "" +t_fmt "" am_pm "";"" t_fmt_ampm "" date_fmt "/ -" +/ +" first_weekday 2 % Monday first_workday 2 % Monday END LC_TIME diff --git a/localedata/locales/iso14651_t1_common b/localedata/locales/iso14651_t1_common index fcbd897f0e..35c0af0b21 100644 --- a/localedata/locales/iso14651_t1_common +++ b/localedata/locales/iso14651_t1_common @@ -63,6 +63,7 @@ script script script script +script # Déclaration des symboles internes / Declaration of internal symbols # @@ -742,6 +743,79 @@ collating-symbol collating-symbol collating-symbol +# +# +# pm - denotes panjabi matras +# pvw - panjabi denotes vowels +# pavd - denotes panjabi vowel modifier +# PNKT - Punjabi Nukta + +# defning symbols +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol + # Ordre des symboles internes / Order of internal symbols # # SYMB. N° @@ -1413,6 +1487,76 @@ collating-symbol +# +# +# +# collation weights in order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + order_start ;forward;backward;forward;forward,position # # Tout caractère non précisément défini sera considéré comme caractère spécial @@ -3472,6 +3616,88 @@ order_start ;forward;forward;forward;forward,position ;;;IGNORE ;;;IGNORE +order_start ;forward;forward;forward;forward,position + <0>;"";"";IGNORE + <1>;"";"";IGNORE + <2>;"";"";IGNORE + <3>;"";"";IGNORE + <4>;"";"";IGNORE + <5>;"";"";IGNORE + <6>;"";"";IGNORE + <7>;"";"";IGNORE + <8>;"";"";IGNORE + <9>;"";"";IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;"";"";IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;"";"";IGNORE + ;;;IGNORE + ;"";"";IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;"";"";IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;"";"";IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;"";"";IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + IGNORE;;;IGNORE + IGNORE;;;IGNORE + order_end END LC_COLLATE diff --git a/localedata/tst-strptime.c b/localedata/tst-strptime.c index b5ab232d7e..bc2c7f1b64 100644 --- a/localedata/tst-strptime.c +++ b/localedata/tst-strptime.c @@ -1,22 +1,53 @@ #include #include #include +#include static int do_test (void) { + int result = 0; + if (setlocale (LC_ALL, "vi_VN.TCVN5712-1") == NULL) { puts ("cannot set locale"); return 1; } struct tm tm; + memset (&tm, '\0', sizeof (tm)); /* This is November in Vietnamese encoded using TCVN5712-1. */ static const char s[] = "\ -\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74"; +\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74\0"; char *r = strptime (s, "%b", &tm); printf ("r = %p, r-s = %tu, tm.tm_mon = %d\n", r, r - s, tm.tm_mon); - return r == NULL || r - s != 14 || tm.tm_mon != 10; + result = r == NULL || r - s != 14 || tm.tm_mon != 10; + + if (setlocale (LC_ALL, "ja_JP.UTF-8") == NULL) + { + puts ("cannot set locale"); + return 1; + } + static const char s2[] = "\ +\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\0"; + memset (&tm, '\0', sizeof (tm)); + r = strptime (s2, "%d %m %EC%Ey", &tm); + printf ("\ +r = %p, r-s2 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n", + r, r - s2, tm.tm_mday, tm.tm_mon, tm.tm_year); + result |= (r == NULL || r - s2 != 14 || tm.tm_mday != 25 || tm.tm_mon != 5 + || tm.tm_year != 108); + + static const char s3[] = "\ +\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\xe5\xb9\xb4\0"; + memset (&tm, '\0', sizeof (tm)); + r = strptime (s3, "%d %m %EY", &tm); + printf ("\ +r = %p, r-s3 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n", + r, r - s3, tm.tm_mday, tm.tm_mon, tm.tm_year); + result |= (r == NULL || r - s3 != 17 || tm.tm_mday != 25 || tm.tm_mon != 5 + || tm.tm_year != 108); + + return result; } #define TEST_FUNCTION do_test () diff --git a/nscd/connections.c b/nscd/connections.c index bef1c16d1e..0afc95a227 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -51,6 +51,7 @@ #include "nscd.h" #include "dbg_log.h" #include "selinux.h" +#include #ifdef HAVE_SENDFILE # include #endif @@ -228,6 +229,9 @@ static int sock; #ifdef HAVE_INOTIFY /* Inotify descriptor. */ static int inotify_fd = -1; + +/* Watch descriptor for resolver configuration file. */ +static int resolv_conf_descr = -1; #endif /* Number of times clients had to wait. */ @@ -824,7 +828,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), if (dbs[cnt].check_file) { #ifdef HAVE_INOTIFY - if (inotify_fd == -1 + if (inotify_fd < 0 || (dbs[cnt].inotify_descr = inotify_add_watch (inotify_fd, dbs[cnt].filename, IN_DELETE_SELF | IN_MODIFY)) < 0) @@ -845,6 +849,14 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), dbs[cnt].file_mtime = st.st_mtime; } } + +#ifdef HAVE_INOTIFY + if (cnt == hstdb && inotify_fd >= -1) + /* We also monitor the resolver configuration file. */ + resolv_conf_descr = inotify_add_watch (inotify_fd, + _PATH_RESCONF, + IN_DELETE_SELF | IN_MODIFY); +#endif } /* Create the socket. */ @@ -1798,6 +1810,7 @@ main_loop_poll (void) { if (conns[1].revents != 0) { + bool done[lastdb] = { false, }; union { struct inotify_event i; @@ -1806,16 +1819,25 @@ main_loop_poll (void) while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev, sizeof (inev))) - >= sizeof (struct inotify_event)) + >= (ssize_t) sizeof (struct inotify_event)) { /* Check which of the files changed. */ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt) - if (inev.i.wd == dbs[dbcnt].inotify_descr) + if (!done[dbcnt] + && (inev.i.wd == dbs[dbcnt].inotify_descr + || (dbcnt == hstdb + && inev.i.wd == resolv_conf_descr))) { - pthread_mutex_trylock (&dbs[dbcnt].prune_lock); + if (dbcnt == hstdb + && inev.i.wd == resolv_conf_descr) + res_init (); + + pthread_mutex_lock (&dbs[dbcnt].prune_lock); dbs[dbcnt].clear_cache = 1; pthread_mutex_unlock (&dbs[dbcnt].prune_lock); pthread_cond_signal (&dbs[dbcnt].prune_cond); + + done[dbcnt] = true; break; } } @@ -1952,7 +1974,7 @@ main_loop_epoll (int efd) while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev, sizeof (inev))) - >= sizeof (struct inotify_event)) + >= (ssize_t) sizeof (struct inotify_event)) { /* Check which of the files changed. */ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt) diff --git a/posix/tst-regex.c b/posix/tst-regex.c index 6a71e1239a..a7fba698f2 100644 --- a/posix/tst-regex.c +++ b/posix/tst-regex.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2003, 2008 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 @@ -55,8 +55,8 @@ static int run_test_backwards (const char *expr, const char *mem, size_t memlen, int icase, int expected); -int -main (int argc, char *argv[]) +static int +do_test (void) { const char *file; int fd; @@ -66,16 +66,9 @@ main (int argc, char *argv[]) char *outmem; size_t inlen; size_t outlen; - static const struct option options[] = - { - {"timing",no_argument, &timing, 1 }, - {NULL, 0, NULL, 0 } - }; mtrace (); - while (getopt_long (argc, argv, "", options, NULL) >= 0); - /* Make the content of the file available in memory. */ file = "../ChangeLog.8"; fd = open (file, O_RDONLY); @@ -506,3 +499,10 @@ run_test_backwards (const char *expr, const char *mem, size_t memlen, expect. */ return cnt != expected; } + +/* If --timing is used we will need a larger timout. */ +#define TIMEOUT 50 +#define CMDLINE_OPTIONS \ + {"timing", no_argument, &timing, 1 }, +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/resolv/res_debug.c b/resolv/res_debug.c index cd69d4f4d4..76fd34bf3c 100644 --- a/resolv/res_debug.c +++ b/resolv/res_debug.c @@ -439,6 +439,7 @@ const struct res_sym __p_type_syms[] = { {ns_t_nimloc, "NIMLOC", "NIMROD locator (unimplemented)"}, {ns_t_srv, "SRV", "server selection"}, {ns_t_atma, "ATMA", "ATM address (unimplemented)"}, + {ns_t_dname, "DNAME", "Non-terminal DNAME (for IPv6)"}, {ns_t_tsig, "TSIG", "transaction signature"}, {ns_t_ixfr, "IXFR", "incremental zone transfer"}, {ns_t_axfr, "AXFR", "zone transfer"}, diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c index 19808b50d6..67e4d05535 100644 --- a/stdlib/canonicalize.c +++ b/stdlib/canonicalize.c @@ -1,5 +1,5 @@ /* Return the canonical absolute name of a given file. - Copyright (C) 1996-2002, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1996-2002,2004,2005,2006,2008 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 @@ -173,7 +173,7 @@ __realpath (const char *name, char *resolved) goto error; } - n = __readlink (rpath, buf, path_max); + n = __readlink (rpath, buf, path_max - 1); if (n < 0) goto error; buf[n] = '\0'; diff --git a/stdlib/tst-setcontext.c b/stdlib/tst-setcontext.c index beec23a686..51296f74ab 100644 --- a/stdlib/tst-setcontext.c +++ b/stdlib/tst-setcontext.c @@ -150,7 +150,10 @@ main (void) if (getcontext (&ctx[1]) != 0) { if (errno == ENOSYS) - exit (0); + { + back_in_main = 1; + exit (0); + } printf ("%s: getcontext: %m\n", __FUNCTION__); exit (1); diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 668aaaf8b5..2440682903 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -367,6 +367,7 @@ __libc_read (int fd, void *buf, size_t nbytes) mach_msg_type_number_t nread; data = buf; + nread = nbytes; err = __io_read ((mach_port_t) fd, &data, &nread, -1, nbytes); if (err) return __hurd_fail (err); diff --git a/sysdeps/mach/hurd/recv.c b/sysdeps/mach/hurd/recv.c index b001729d18..0cf6b7ce58 100644 --- a/sysdeps/mach/hurd/recv.c +++ b/sysdeps/mach/hurd/recv.c @@ -38,7 +38,7 @@ __recv (fd, buf, n, flags) char *bufp = buf; mach_msg_type_number_t nread = n; mach_port_t *ports; - mach_msg_type_number_t nports; + mach_msg_type_number_t nports = 0; char *cdata = NULL; mach_msg_type_number_t clen = 0; @@ -48,7 +48,7 @@ __recv (fd, buf, n, flags) &cdata, &clen, &flags, n))) - return __hurd_dfail (fd, err); + return __hurd_sockfail (fd, flags, err); __mach_port_deallocate (__mach_task_self (), addrport); __vm_deallocate (__mach_task_self (), (vm_address_t) cdata, clen); diff --git a/sysdeps/mach/hurd/recvfrom.c b/sysdeps/mach/hurd/recvfrom.c index d5c73f4441..2aca5709df 100644 --- a/sysdeps/mach/hurd/recvfrom.c +++ b/sysdeps/mach/hurd/recvfrom.c @@ -41,7 +41,7 @@ __recvfrom (fd, buf, n, flags, addrarg, addr_len) char *bufp = buf; mach_msg_type_number_t nread = n; mach_port_t *ports; - mach_msg_type_number_t nports; + mach_msg_type_number_t nports = 0; char *cdata = NULL; mach_msg_type_number_t clen = 0; struct sockaddr *addr = addrarg.__sockaddr__; @@ -52,7 +52,7 @@ __recvfrom (fd, buf, n, flags, addrarg, addr_len) &cdata, &clen, &flags, n))) - return __hurd_dfail (fd, err); + return __hurd_sockfail (fd, flags, err); /* Get address data for the returned address port if requested. */ if (addr != NULL) @@ -74,7 +74,7 @@ __recvfrom (fd, buf, n, flags, addrarg, addr_len) if (err) { __mach_port_deallocate (__mach_task_self (), addrport); - return __hurd_dfail (fd, err); + return __hurd_sockfail (fd, flags, err); } if (*addr_len > buflen) diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c index c6874e8bd8..33897b8ce8 100644 --- a/sysdeps/mach/hurd/recvmsg.c +++ b/sysdeps/mach/hurd/recvmsg.c @@ -34,7 +34,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) char *data = NULL; mach_msg_type_number_t len = 0; mach_port_t *ports; - mach_msg_type_number_t nports; + mach_msg_type_number_t nports = 0; char *cdata = NULL; mach_msg_type_number_t clen = 0; size_t amount; @@ -63,7 +63,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) &ports, &nports, &cdata, &clen, &message->msg_flags, amount))) - return __hurd_dfail (fd, err); + return __hurd_sockfail (fd, flags, err); if (message->msg_name != NULL) { @@ -84,7 +84,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) if (err) { __mach_port_deallocate (__mach_task_self (), aport); - return __hurd_dfail (fd, err); + return __hurd_sockfail (fd, flags, err); } if (message->msg_namelen > buflen) diff --git a/sysdeps/mach/hurd/send.c b/sysdeps/mach/hurd/send.c index 4810cd68c3..bb45c50696 100644 --- a/sysdeps/mach/hurd/send.c +++ b/sysdeps/mach/hurd/send.c @@ -38,7 +38,7 @@ __send (fd, buf, n, flags) NULL, MACH_MSG_TYPE_COPY_SEND, 0, NULL, 0, &wrote)); - return err ? __hurd_dfail (fd, err) : wrote; + return err ? __hurd_sockfail (fd, flags, err) : wrote; } libc_hidden_def (__send) weak_alias (__send, send) diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c index 5fdfd734ec..a9d1c8c1d4 100644 --- a/sysdeps/mach/hurd/sendmsg.c +++ b/sysdeps/mach/hurd/sendmsg.c @@ -149,7 +149,7 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) if (dealloc) __vm_deallocate (__mach_task_self (), data.addr, len); - return err ? __hurd_dfail (fd, err) : amount; + return err ? __hurd_sockfail (fd, flags, err) : amount; } weak_alias (__libc_sendmsg, sendmsg) diff --git a/sysdeps/mach/hurd/sendto.c b/sysdeps/mach/hurd/sendto.c index 0a6912a3b7..478a5c9a41 100644 --- a/sysdeps/mach/hurd/sendto.c +++ b/sysdeps/mach/hurd/sendto.c @@ -79,7 +79,7 @@ __sendto (int fd, err; })); - return err ? __hurd_dfail (fd, err) : wrote; + return err ? __hurd_sockfail (fd, flags, err) : wrote; } weak_alias (__sendto, sendto) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 5c82b5274a..4987505c5e 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -684,6 +684,9 @@ gaih_inet (const char *name, const struct gaih_service *service, "dns [!UNAVAIL=return] files", &nip); + /* Initialize configurations. */ + if (__builtin_expect (!_res_hconf.initialized, 0)) + _res_hconf_init (); if (__res_maybe_init (&_res, 0) == -1) no_more = 1; @@ -883,9 +886,6 @@ gaih_inet (const char *name, const struct gaih_service *service, } } - if (pai == NULL) - return 0; - { struct gaih_servtuple *st2; struct gaih_addrtuple *at2 = at; @@ -2091,10 +2091,6 @@ getaddrinfo (const char *name, const char *service, if ((hints->ai_flags & AI_CANONNAME) && name == NULL) return EAI_BADFLAGS; - /* Initialize configurations. */ - if (__builtin_expect (!_res_hconf.initialized, 0)) - _res_hconf_init (); - struct in6addrinfo *in6ai = NULL; size_t in6ailen = 0; bool seen_ipv4 = false; @@ -2149,11 +2145,7 @@ getaddrinfo (const char *name, const char *service, else pservice = NULL; - struct addrinfo **end; - if (pai) - end = &p; - else - end = NULL; + struct addrinfo **end = &p; unsigned int naddrs = 0; if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET @@ -2167,12 +2159,11 @@ getaddrinfo (const char *name, const char *service, return -(last_i & GAIH_EAI); } - if (end) - while (*end) - { - end = &((*end)->ai_next); - ++nresults; - } + while (*end) + { + end = &((*end)->ai_next); + ++nresults; + } } else { @@ -2368,9 +2359,6 @@ getaddrinfo (const char *name, const char *service, return 0; } - if (pai == NULL && last_i == 0) - return 0; - return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME; } libc_hidden_def (getaddrinfo) diff --git a/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/sysdeps/unix/bsd/bsd4.4/bits/socket.h index 67db4d8469..2ccd01d011 100644 --- a/sysdeps/unix/bsd/bsd4.4/bits/socket.h +++ b/sysdeps/unix/bsd/bsd4.4/bits/socket.h @@ -171,8 +171,10 @@ enum #define MSG_CTRUNC MSG_CTRUNC MSG_WAITALL = 0x40, /* Wait for full request or error. */ #define MSG_WAITALL MSG_WAITALL - MSG_DONTWAIT = 0x80 /* This message should be nonblocking. */ + MSG_DONTWAIT = 0x80, /* This message should be nonblocking. */ #define MSG_DONTWAIT MSG_DONTWAIT + MSG_NOSIGNAL = 0x0400 /* Do not generate SIGPIPE on EPIPE. */ +#define MSG_NOSIGNAL MSG_NOSIGNAL }; diff --git a/time/strptime_l.c b/time/strptime_l.c index 59a557c22b..c4a0638fff 100644 --- a/time/strptime_l.c +++ b/time/strptime_l.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2004, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2004, 2005, 2007, 2008 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 @@ -33,22 +33,13 @@ #endif -#ifndef __P -# if defined __GNUC__ || (defined __STDC__ && __STDC__) -# define __P(args) args -# else -# define __P(args) () -# endif /* GCC. */ -#endif /* Not __P. */ - - #if ! HAVE_LOCALTIME_R && ! defined localtime_r # ifdef _LIBC # define localtime_r __localtime_r # else /* Approximate localtime_r as best we can in its absence. */ # define localtime_r my_localtime_r -static struct tm *localtime_r __P ((const time_t *, struct tm *)); +static struct tm *localtime_r (const time_t *, struct tm *); static struct tm * localtime_r (t, tp) const time_t *t; @@ -951,7 +942,6 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM) else { s.decided = loc; - s.era_cnt = -1; break; } -- cgit v1.2.3