From a452e4e6294ffb6d7362215cb0b10896e8a7631f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 4 Sep 2003 12:31:47 +0000 Subject: Update. 2003-09-04 Ulrich Drepper * nss/getXXbyYY.c (FUNCTION_NAME): Add a few casts. Remove unnecessary errno handling. * nss/getXXbyYY_r.c (INTERNAL): Use better variable name. Initialize it in all cases. Change it to be a bit more like the code we had before. --- nss/getXXbyYY_r.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'nss/getXXbyYY_r.c') diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c index a0e0e003b7..99639593b8 100644 --- a/nss/getXXbyYY_r.c +++ b/nss/getXXbyYY_r.c @@ -248,23 +248,22 @@ done: POSTPROCESS; #endif - int result; + int res; if (status == NSS_STATUS_SUCCESS) - result = 0; + res = 0; /* Don't pass back ERANGE if this is not for a too-small buffer. */ else if (errno == ERANGE && status != NSS_STATUS_TRYAGAIN) - { + res = EINVAL; #ifdef NEED_H_ERRNO - /* These functions only set errno if h_errno is NETDB_INTERNAL. */ - if (*h_errnop != NETDB_INTERNAL) + /* These functions only set errno if h_errno is NETDB_INTERNAL. */ + else if (status == NSS_STATUS_TRYAGAIN && *h_errnop != NETDB_INTERNAL) + res = EAGAIN; #endif - result = ENOENT; - } else return errno; - __set_errno (result); - return result; + __set_errno (res); + return res; } -- cgit v1.2.3