diff options
author | Ulrich Drepper <drepper@redhat.com> | 2008-12-03 07:30:39 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2008-12-03 07:30:39 +0000 |
commit | da5ac1352d139a70edb550bb5ff2a2879eaaa926 (patch) | |
tree | f34c42153913c35ad66b30db5fc480ac11d3f843 /resolv/nss_dns | |
parent | 6f5c31171fbd45c79c9bbeea4d6305f9c798e421 (diff) | |
download | glibc-da5ac1352d139a70edb550bb5ff2a2879eaaa926.tar.gz glibc-da5ac1352d139a70edb550bb5ff2a2879eaaa926.tar.xz glibc-da5ac1352d139a70edb550bb5ff2a2879eaaa926.zip |
* 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.
Diffstat (limited to 'resolv/nss_dns')
-rw-r--r-- | resolv/nss_dns/dns-host.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index 6cbfcb63ce..b8e513a929 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; |