From 9bfce4bf2865c2981a8d790ae7f6c50c4e87dd97 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 12 Sep 2002 02:58:43 +0000 Subject: * nss/getnssent_r.c (__nss_getent_r): Use EAGAIN instead of errno when using h_errno and it's not set to NETDB_INTERNAL. * nss/getXXbyYY_r.c [NEED_H_ERRNO]: Likewise. * Makefile ($(common-objpfx)testrun.sh): New target. (others): Depend on it. (postclean-generated): Append it. --- nss/getnssent_r.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nss/getnssent_r.c') diff --git a/nss/getnssent_r.c b/nss/getnssent_r.c index 39c867ce79..c1f8965363 100644 --- a/nss/getnssent_r.c +++ b/nss/getnssent_r.c @@ -197,6 +197,9 @@ __nss_getent_r (const char *getent_func_name, } *result = status == NSS_STATUS_SUCCESS ? resbuf : NULL; - return (status == NSS_STATUS_SUCCESS - ? 0 : status == NSS_STATUS_TRYAGAIN ? errno : ENOENT); + return (status == NSS_STATUS_SUCCESS ? 0 + : status != NSS_STATUS_TRYAGAIN ? ENOENT + /* h_errno functions only set errno if h_errno is NETDB_INTERNAL. */ + : (h_errnop == NULL || *h_errnop == NETDB_INTERNAL) ? errno + : EAGAIN); } -- cgit v1.2.3