about summary refs log tree commit diff
path: root/nis/nis_call.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-03-24 19:28:00 +0000
committerUlrich Drepper <drepper@redhat.com>2008-03-24 19:28:00 +0000
commit0facd3df4b2faeb6088fa9bf47e94ff6af256750 (patch)
tree11e6c5a2e9c951f06f6ecd5d803c7b99543c8926 /nis/nis_call.c
parent7e570c5520d0db2a9f7d10135bc43cf5839cb234 (diff)
downloadglibc-0facd3df4b2faeb6088fa9bf47e94ff6af256750.tar.gz
glibc-0facd3df4b2faeb6088fa9bf47e94ff6af256750.tar.xz
glibc-0facd3df4b2faeb6088fa9bf47e94ff6af256750.zip
* nis/nis_call.c (nis_server_cache_search): Save errno around stat
	call.
	(__nisfind_server): Similar for open readColdStartFile call.
	Patch partially by Jim Meyering.
	* nss/nss_files/files-XXX.c (_nss_files_getXXent_r): Save errno
	around internal_setent call.
Diffstat (limited to 'nis/nis_call.c')
-rw-r--r--nis/nis_call.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nis/nis_call.c b/nis/nis_call.c
index c571e8f367..6ae4ce5dbd 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2001, 2004, 2005, 2006, 2007
+/* Copyright (C) 1997, 1998, 2001, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@@ -592,8 +592,10 @@ nis_server_cache_search (const_nis_name name, int search_parent,
   XDR xdrs;
   struct stat64 st;
 
+  int saved_errno = errno;
   if (stat64 ("/var/nis/NIS_COLD_START", &st) < 0)
     st.st_mtime = nis_cold_start_mtime + 1;
+  __set_errno (saved_errno);
 
   __libc_lock_lock (nis_server_cache_lock);
 
@@ -741,7 +743,9 @@ __nisfind_server (const_nis_name name, int search_parent,
       return result;
     }
 
+  int saved_errno = errno;
   *dir = readColdStartFile ();
+  __set_errno (saved_errno);
   if (*dir == NULL)
     /* No /var/nis/NIS_COLD_START->no NIS+ installed.  */
     return NIS_UNAVAIL;