[PATCH][BZ #14719] Return EAI_SYSTEM from getaddrinfo if we run out of fds

Andreas Schwab schwab@linux-m68k.org
Tue Oct 23 12:22:00 GMT 2012


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."



More information about the Libc-alpha mailing list