about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-31 00:02:18 +0000
committerRoland McGrath <roland@gnu.org>2002-08-31 00:02:18 +0000
commit8fea756af2baa7cf5b4012ee700da3cdd5b10db9 (patch)
tree59306af65f719a21fb247a0c8b0f381fd382b188
parente932b4062e0becb827e3fbde008e99d058f89096 (diff)
downloadglibc-8fea756af2baa7cf5b4012ee700da3cdd5b10db9.tar.gz
glibc-8fea756af2baa7cf5b4012ee700da3cdd5b10db9.tar.xz
glibc-8fea756af2baa7cf5b4012ee700da3cdd5b10db9.zip
* nss/getnssent_r.c (__nss_getent_r): Return ENOENT if status is
	neither SUCCESS nor TRYAGAIN (see 2002-08-25 change [PR libc/4259]).

	* nss/getnssent_r.c (__nss_getent_r): Set *H_ERRNOP, not global one.
-rw-r--r--ChangeLog5
-rw-r--r--nss/getnssent_r.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 38ab651239..61a603d5bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2002-08-30  Roland McGrath  <roland@redhat.com>
 
+	* nss/getnssent_r.c (__nss_getent_r): Return ENOENT if status is
+	neither SUCCESS nor TRYAGAIN (see 2002-08-25 change [PR libc/4259]).
+
+	* nss/getnssent_r.c (__nss_getent_r): Set *H_ERRNOP, not global one.
+
 	* sysdeps/x86_64/hp-timing.h (HP_TIMING_NOW, HP_TIMING_ACCUM): New
 	macros replace the i686 versions for 64-bit mode.
 
diff --git a/nss/getnssent_r.c b/nss/getnssent_r.c
index 0c10ece562..39c867ce79 100644
--- a/nss/getnssent_r.c
+++ b/nss/getnssent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000,02 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -71,7 +71,7 @@ __nss_setent (const char *func_name, db_lookup_function lookup_fct,
     {
       int is_last_nip = *nip == *last_nip;
       enum nss_status status;
-      
+
       if (stayopen_tmp)
 	status = DL_CALL_FCT (fct, (*stayopen_tmp));
       else
@@ -136,7 +136,7 @@ __nss_getent_r (const char *getent_func_name,
   if (res && (_res.options & RES_INIT) == 0
       && __res_ninit (&_res) == -1)
     {
-      __set_h_errno (NETDB_INTERNAL);
+      *h_errnop = NETDB_INTERNAL;
       *result = NULL;
       return errno;
     }
@@ -197,5 +197,6 @@ __nss_getent_r (const char *getent_func_name,
     }
 
   *result = status == NSS_STATUS_SUCCESS ? resbuf : NULL;
-  return status == NSS_STATUS_SUCCESS ? 0 : errno;
+  return (status == NSS_STATUS_SUCCESS
+	  ? 0 : status == NSS_STATUS_TRYAGAIN ? errno : ENOENT);
 }