This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #14719] Return EAI_SYSTEM from getaddrinfo if we run out of fds
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 23 Oct 2012 14:21:48 +0200
- Subject: Re: [PATCH][BZ #14719] Return EAI_SYSTEM from getaddrinfo if we run out of fds
- References: <20121023171835.09f1b085@spoyarek>
Siddhesh Poyarekar <siddhesh@redhat.com> writes:
> + else if (status != NSS_STATUS_SUCCESS && !any_service)
> + /* We were no able to use any service. */
not
> *h_errnop = NO_RECOVERY;
> #endif
> #ifdef POSTPROCESS
> diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
> index 6b62c05..102afb2 100644
> --- a/resolv/nss_dns/dns-host.c
> +++ b/resolv/nss_dns/dns-host.c
> @@ -199,6 +199,10 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result,
> status = NSS_STATUS_TRYAGAIN;
> h_errno = TRY_AGAIN;
> break;
> + /* System has run out of file descriptors. */
> + case EMFILE:
> + case ENFILE:
> + h_errno = NETDB_INTERNAL;
> case ECONNREFUSED:
> case ETIMEDOUT:
> status = NSS_STATUS_UNAVAIL;
Wouldn't NSS_STATUS_TRYAGAIN make more sense for E[MN]FILE?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."