From cfde9b463d63092ff0908d4c2748ace648e2ead8 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 19 Nov 2012 13:01:43 +0530 Subject: Return EAI_SYSTEM if we're out of file descriptors Resolves BZ #14719. --- nss/getXXbyYY_r.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nss') diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c index 8b3b61b663..885b53b60b 100644 --- a/nss/getXXbyYY_r.c +++ b/nss/getXXbyYY_r.c @@ -284,7 +284,12 @@ done: #endif *result = status == NSS_STATUS_SUCCESS ? resbuf : NULL; #ifdef NEED_H_ERRNO - if (status != NSS_STATUS_SUCCESS && ! any_service) + if (status == NSS_STATUS_UNAVAIL) + /* Either we failed to lookup the functions or the functions themselves + had a system error. Set NETDB_INTERNAL here to let the caller know + that the errno may have the real reason for failure. */ + *h_errnop = NETDB_INTERNAL; + else if (status != NSS_STATUS_SUCCESS && !any_service) /* We were not able to use any service. */ *h_errnop = NO_RECOVERY; #endif -- cgit v1.2.3