From: Ulrich Drepper Date: Wed, 3 Dec 2008 07:30:39 +0000 (+0000) Subject: * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Recognize X-Git-Tag: upstream/2.30~13948 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da5ac1352d139a70edb550bb5ff2a2879eaaa926;p=external%2Fglibc.git * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Recognize ESRCH return value. (_nss_dns_gethostbyname4_r): Likewise. * resolv/res_init.c (__res_vinit): Initialize nscount to zero. * sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use gethostbyname4_r, we don't have a separate IPv6 status, so copy the no_data variable. --- diff --git a/ChangeLog b/ChangeLog index c834934..448c7b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-12-02 Ulrich Drepper + * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Recognize + ESRCH return value. + (_nss_dns_gethostbyname4_r): Likewise. + * resolv/res_init.c (__res_vinit): Initialize nscount to zero. + * sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use + gethostbyname4_r, we don't have a separate IPv6 status, so copy + the no_data variable. + * resolv/res_init.c (__res_vinit): Fill in IPv4 name server information at the correct index. diff --git a/nptl/ChangeLog b/nptl/ChangeLog index f313815..512fce7 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,12 @@ +2008-12-02 Ulrich Drepper + + * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET + and FUTEX_WAKE_BITSET. + * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise. + 2008-11-25 Roland McGrath * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha: diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h index d53559c..993dd4b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2002-2004, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -52,6 +52,8 @@ #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 #define FUTEX_PRIVATE_FLAG 128 #define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) @@ -86,7 +88,7 @@ asm ("andl %%gs:%P1, %0" : "+r" (__fl) \ : "i" (offsetof (struct pthread, header.private_futex))); \ __fl | (fl); })) -# endif +# endif #endif #ifndef __ASSEMBLER__ diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h index ada7985..9c4d16f 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 2003. @@ -37,6 +37,8 @@ #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 #define FUTEX_PRIVATE_FLAG 128 /* Values for 'private' parameter of locking macros. Yes, the @@ -67,7 +69,7 @@ : (fl)) \ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) -# endif +# endif #endif diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h index 80b9a43..76a41bc 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras , 2003. @@ -38,6 +38,8 @@ #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 #define FUTEX_PRIVATE_FLAG 128 /* Values for 'private' parameter of locking macros. Yes, the @@ -67,7 +69,7 @@ : (fl)) \ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) -# endif +# endif #endif #define lll_futex_wait(futexp, val, private) \ @@ -131,8 +133,8 @@ FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ }) - - + + #ifdef UP # define __lll_acq_instr "" # define __lll_rel_instr "" diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index c9347e9..558d87d 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky , 2003. @@ -36,6 +36,8 @@ #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 #define FUTEX_PRIVATE_FLAG 128 /* Values for 'private' parameter of locking macros. Yes, the @@ -66,7 +68,7 @@ : (fl)) \ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) -# endif +# endif #endif #define lll_futex_wait(futex, val, private) \ diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h index 2cd69a1..f76d599 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2004, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -52,6 +52,8 @@ #define FUTEX_LOCK_PI 6 #define FUTEX_UNLOCK_PI 7 #define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 #define FUTEX_PRIVATE_FLAG 128 #define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) @@ -87,7 +89,7 @@ asm ("andl %%fs:%P1, %0" : "+r" (__fl) \ : "i" (offsetof (struct pthread, header.private_futex))); \ __fl | (fl); })) -# endif +# endif #endif /* Initializer for lock. */ diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index 6cbfcb6..b8e513a 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -198,8 +198,14 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result, 1024, &host_buffer.ptr, NULL, NULL, NULL); if (n < 0) { - status = (errno == ECONNREFUSED - ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND); + if (errno == ESRCH) + { + status = NSS_STATUS_TRYAGAIN; + h_errno = TRY_AGAIN; + } + else + status = (errno == ECONNREFUSED + ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND); *h_errnop = h_errno; if (h_errno == TRY_AGAIN) *errnop = EAGAIN; @@ -304,8 +310,14 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, &ans2p, &nans2p, &resplen2); if (n < 0) { - status = (errno == ECONNREFUSED - ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND); + if (errno == ESRCH) + { + status = NSS_STATUS_TRYAGAIN; + h_errno = TRY_AGAIN; + } + else + status = (errno == ECONNREFUSED + ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND); *herrnop = h_errno; if (h_errno == TRY_AGAIN) *errnop = EAGAIN; diff --git a/resolv/res_init.c b/resolv/res_init.c index d93dc82..0cdd55e 100644 --- a/resolv/res_init.c +++ b/resolv/res_init.c @@ -183,7 +183,7 @@ __res_vinit(res_state statp, int preinit) { #endif statp->nsaddr.sin_family = AF_INET; statp->nsaddr.sin_port = htons(NAMESERVER_PORT); - statp->nscount = 1; + statp->nscount = 0; statp->ndots = 1; statp->pfcode = 0; statp->_vcsock = -1; diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 72fbdb0..6ff0fc4 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -733,6 +733,8 @@ gaih_inet (const char *name, const struct gaih_service *service, tmpbuflen, 2 * tmpbuflen); } + no_inet6_data = no_data; + if (status == NSS_STATUS_SUCCESS) { if ((req->ai_flags & AI_CANONNAME) != 0 && canon == NULL)