diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-11-15 08:22:03 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-11-15 08:22:03 +0000 |
commit | 22d7fbdbae4032639461a7a081762a05deee0529 (patch) | |
tree | ff70bd4613f1f05823b2417b2687449d73ac45b0 /sysdeps/posix | |
parent | 1beea155aecf2e7d6bfa1399b7c0f4f53dde408c (diff) |
Updated to fedora-glibc-20051115T0809
Diffstat (limited to 'sysdeps/posix')
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 30 | ||||
-rw-r--r-- | sysdeps/posix/gettimeofday.c | 8 | ||||
-rw-r--r-- | sysdeps/posix/system.c | 6 |
3 files changed, 18 insertions, 26 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 934aae009c..81a56a0794 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -568,12 +568,14 @@ gaih_inet (const char *name, const struct gaih_service *service, if (at->family == AF_UNSPEC) { - char *namebuf = strdupa (name); - char *scope_delim; + char *namebuf = (char *) name; + char *scope_delim = strchr (name, SCOPE_DELIMITER); - scope_delim = strchr (namebuf, SCOPE_DELIMITER); - if (scope_delim != NULL) - *scope_delim = '\0'; + if (__builtin_expect (scope_delim != NULL, 0)) + { + namebuf = alloca (scope_delim - name + 1); + *((char *) __mempcpy (namebuf, name, scope_delim - name)) = '\0'; + } if (inet_pton (AF_INET6, namebuf, at->addr) > 0) { @@ -629,7 +631,10 @@ gaih_inet (const char *name, const struct gaih_service *service, /* If we do not have to look for IPv4 and IPv6 together, use the simple, old functions. */ - if (req->ai_family == AF_INET || req->ai_family == AF_INET6) + if (req->ai_family == AF_INET + || (req->ai_family == AF_INET6 + && ((req->ai_flags & AI_V4MAPPED) == 0 + || (req->ai_flags & AI_ALL) == 0))) { int family = req->ai_family; size_t tmpbuflen = 512; @@ -888,8 +893,8 @@ gaih_inet (const char *name, const struct gaih_service *service, AF_INET6. Try to find a useful one for both. */ if (inet6_status == NSS_STATUS_TRYAGAIN) status = NSS_STATUS_TRYAGAIN; - else if (status == NSS_STATUS_UNAVAIL && - inet6_status != NSS_STATUS_UNAVAIL) + else if (status == NSS_STATUS_UNAVAIL + && inet6_status != NSS_STATUS_UNAVAIL) status = inet6_status; } @@ -1039,9 +1044,9 @@ gaih_inet (const char *name, const struct gaih_service *service, } } - if (at2->family == AF_INET6) + family = at2->family; + if (family == AF_INET6) { - family = AF_INET6; socklen = sizeof (struct sockaddr_in6); /* If we looked up IPv4 mapped address discard them here if @@ -1053,10 +1058,7 @@ gaih_inet (const char *name, const struct gaih_service *service, goto ignore; } else - { - family = AF_INET; - socklen = sizeof (struct sockaddr_in); - } + socklen = sizeof (struct sockaddr_in); for (st2 = st; st2 != NULL; st2 = st2->next) { diff --git a/sysdeps/posix/gettimeofday.c b/sysdeps/posix/gettimeofday.c index 28f75b0bcc..bda40f48ec 100644 --- a/sysdeps/posix/gettimeofday.c +++ b/sysdeps/posix/gettimeofday.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 94, 95, 96, 97, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1991,1992,1994-1997,2002,2005 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 @@ -20,12 +20,6 @@ #include <time.h> #include <sys/time.h> -#ifndef HAVE_GNU_LD -#define __daylight daylight -#define __timezone timezone -#define __tzname tzname -#endif - #undef __gettimeofday /* Get the current time of day and timezone information, diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c index 8548313314..f63dde4dae 100644 --- a/sysdeps/posix/system.c +++ b/sysdeps/posix/system.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1991-2000, 2002, 2003, 2005 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 @@ -27,10 +27,6 @@ #include <sysdep-cancel.h> -#ifndef HAVE_GNU_LD -#define __environ environ -#endif - #define SHELL_PATH "/bin/sh" /* Path of the shell. */ #define SHELL_NAME "sh" /* Name to give it. */ |