about summary refs log tree commit diff
path: root/nss/getXXbyYY.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-11-15 04:08:00 +0000
committerUlrich Drepper <drepper@redhat.com>1996-11-15 04:08:00 +0000
commit54d79e995d5a6d0a393ed913b6e26dccc63de5b7 (patch)
treeb758eeac8325f123f161c8d62c5956dc2a6d2556 /nss/getXXbyYY.c
parentb296c233447a37f77ccd9989fce24b45a8db1afa (diff)
downloadglibc-54d79e995d5a6d0a393ed913b6e26dccc63de5b7.tar.gz
glibc-54d79e995d5a6d0a393ed913b6e26dccc63de5b7.tar.xz
glibc-54d79e995d5a6d0a393ed913b6e26dccc63de5b7.zip
update from main archive 961114 cvs/libc-961115
Diffstat (limited to 'nss/getXXbyYY.c')
-rw-r--r--nss/getXXbyYY.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c
index 2a84db974a..8449a38973 100644
--- a/nss/getXXbyYY.c
+++ b/nss/getXXbyYY.c
@@ -56,7 +56,7 @@
 /* Sometimes we need to store error codes in the `h_errno' variable.  */
 #ifdef NEED_H_ERRNO
 # define H_ERRNO_PARM , int *h_errnop
-# define H_ERRNO_VAR , &h_errno
+# define H_ERRNO_VAR , &h_errno_tmp
 #else
 # define H_ERRNO_PARM
 # define H_ERRNO_VAR
@@ -80,6 +80,9 @@ FUNCTION_NAME (ADD_PARAMS)
   static LOOKUP_TYPE resbuf;
   LOOKUP_TYPE *result;
   int save;
+#ifdef NEED_H_ERRNO
+  int h_errno_tmp = 0;
+#endif
 
   /* Get lock.  */
   __libc_lock_lock (lock);
@@ -110,5 +113,10 @@ FUNCTION_NAME (ADD_PARAMS)
   __libc_lock_unlock (lock);
   __set_errno (save);
 
+#ifdef NEED_H_ERRNO
+  if (h_errno_tmp != 0)
+    __set_h_errno (h_errno_tmp);
+#endif
+
   return result;
 }