Make sure we always return a nonzero value in case of an error.
authordrepper <drepper>
Thu, 12 Jun 2003 22:15:23 +0000 (22:15 +0000)
committerdrepper <drepper>
Thu, 12 Jun 2003 22:15:23 +0000 (22:15 +0000)
nss/getXXbyYY_r.c

index 632778d..3f873a5 100644 (file)
@@ -247,12 +247,14 @@ done:
 #ifdef POSTPROCESS
   POSTPROCESS;
 #endif
-  return (status != NSS_STATUS_TRYAGAIN ? 0
+  return (status == NSS_STATUS_SUCCESS ? 0
+         : (status != NSS_STATUS_TRYAGAIN
 #ifdef NEED_H_ERRNO
-         /* These functions only set errno if h_errno is NETDB_INTERNAL.  */
-         : *h_errnop != NETDB_INTERNAL ? EAGAIN
+            /* These functions only set errno if h_errno is
+               NETDB_INTERNAL.  */
+            && *h_errnop == NETDB_INTERNAL
 #endif
-         : errno);
+            ? errno : EAGAIN));
 }