]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 4 Sep 2003 04:43:56 +0000 (04:43 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 4 Sep 2003 04:43:56 +0000 (04:43 +0000)
2003-09-03  Ulrich Drepper  <drepper@redhat.com>

* nss/getXXbyYY_r.c (INTERNAL): Explicitly set errno and avoid
returning ERANGE if this wasn't intended.

ChangeLog
nss/getXXbyYY_r.c

index d757d863be703f3b0c0163fb825dba9dfe3a5893..4b7c0cd1e5dfb6d9ac6eec9a9efe3f149c831c3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-09-03  Ulrich Drepper  <drepper@redhat.com>
+
+       * nss/getXXbyYY_r.c (INTERNAL): Explicitly set errno and avoid
+       returning ERANGE if this wasn't intended.
+
 2003-09-03  Jakub Jelinek  <jakub@redhat.com>
 
        * intl/loadmsgcat.c (open, close, read, mmap, munmap): Define as
index aca6a94a35b510b22328298c0e5ae32e6f093f4b..a0e0e003b7f3fa439071c47a27fb3c93a45adce5 100644 (file)
@@ -247,13 +247,24 @@ done:
 #ifdef POSTPROCESS
   POSTPROCESS;
 #endif
-  return (status == NSS_STATUS_SUCCESS ? 0
+
+  int result;
+  if (status == NSS_STATUS_SUCCESS)
+    result = 0;
+  /* Don't pass back ERANGE if this is not for a too-small buffer.  */
+  else if (errno == ERANGE && status != NSS_STATUS_TRYAGAIN)
+    {
 #ifdef NEED_H_ERRNO
-         /* These functions only set errno if h_errno is NETDB_INTERNAL.  */
-         : status == NSS_STATUS_TRYAGAIN && *h_errnop != NETDB_INTERNAL
-         ? EAGAIN
+      /* These functions only set errno if h_errno is NETDB_INTERNAL.  */
+      if (*h_errnop != NETDB_INTERNAL)
 #endif
-         : errno);
+       result = ENOENT;
+    }
+  else
+    return errno;
+
+  __set_errno (result);
+  return result;
 }
 
 
This page took 0.050661 seconds and 5 git commands to generate.