aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-11-18 08:30:20 +0000
committerUlrich Drepper <drepper@redhat.com>2000-11-18 08:30:20 +0000
commit7813b61a4128191279d0a3f90311787aad057b43 (patch)
tree2f6bce07cbcc5292817e431e7f8ca06d37f66b6f /sysdeps/posix
parent565bc88a12e0bf2e004be8ff22d59ebe55af9627 (diff)
downloadglibc-7813b61a4128191279d0a3f90311787aad057b43.zip
glibc-7813b61a4128191279d0a3f90311787aad057b43.tar.gz
glibc-7813b61a4128191279d0a3f90311787aad057b43.tar.bz2
Update.
2000-11-18 Ulrich Drepper <drepper@redhat.com> * sysdeps/posix/getaddrinfo.c (gaih_inet): Only return -EAI_AGAIN if IPv4 and IPv6 requests timed out.
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/getaddrinfo.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 8b672f2..1686933 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -271,6 +271,7 @@ gaih_inet_serv (const char *servicename, struct gaih_typeproto *tp,
struct hostent th; \
char *tmpbuf; \
tmpbuflen = 512; \
+ no_data = 0; \
do { \
tmpbuflen *= 2; \
tmpbuf = __alloca (tmpbuflen); \
@@ -285,12 +286,11 @@ gaih_inet_serv (const char *servicename, struct gaih_typeproto *tp,
return -EAI_SYSTEM; \
} \
if (herrno == TRY_AGAIN) \
- { \
- __set_h_errno (herrno); \
- return -EAI_AGAIN; \
- } \
+ no_data = EAI_AGAIN; \
+ else \
+ no_data = herrno == NO_DATA; \
} \
- if (h != NULL) \
+ else if (h != NULL) \
{ \
for (i = 0; h->h_addr_list[i]; i++) \
{ \
@@ -305,7 +305,6 @@ gaih_inet_serv (const char *servicename, struct gaih_typeproto *tp,
pat = &((*pat)->next); \
} \
} \
- no_data = rc != 0 && herrno == NO_DATA; \
}
static int
@@ -510,9 +509,15 @@ gaih_inet (const char *name, const struct gaih_service *service,
gethosts (AF_INET, struct in_addr);
if (no_data != 0 && no_inet6_data != 0)
- /* We made requests but they turned out no data. The name
- is known, though. */
- return (GAIH_OKIFUNSPEC | -EAI_NODATA);
+ {
+ /* If both requests timed out report this. */
+ if (no_data == EAI_AGAIN && no_inet6_data == EAI_AGAIN)
+ return -EAI_AGAIN;
+
+ /* We made requests but they turned out no data. The name
+ is known, though. */
+ return (GAIH_OKIFUNSPEC | -EAI_NODATA);
+ }
}
if (at->family == AF_UNSPEC)