summary refs log tree commit diff
path: root/nis
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-07-03 14:49:53 +0000
committerUlrich Drepper <drepper@redhat.com>2007-07-03 14:49:53 +0000
commit57c9179cab174f606a05b0372600efedd3331b92 (patch)
tree9accf6a508b1ba8e1c006be238ac0576548b1d03 /nis
parentd0b283a86136d9dcb05d3b8ce6ee9adb5c5b1494 (diff)
downloadglibc-57c9179cab174f606a05b0372600efedd3331b92.tar.gz
glibc-57c9179cab174f606a05b0372600efedd3331b92.tar.xz
glibc-57c9179cab174f606a05b0372600efedd3331b92.zip
[BZ #4702]
2007-07-03  Jakub Jelinek  <jakub@redhat.com>
	[BZ #4702]
	* nis/nss-default.c: Include errno.h.
	(init): Preserve errno.
Diffstat (limited to 'nis')
-rw-r--r--nis/nss-default.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nis/nss-default.c b/nis/nss-default.c
index 577f7c2d47..046ddfee8d 100644
--- a/nis/nss-default.c
+++ b/nis/nss-default.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 2001, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 2001, 2004, 2006, 2007 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
@@ -17,6 +17,7 @@
    02111-1307 USA.  */
 
 #include <ctype.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdio_ext.h>
 #include <stdlib.h>
@@ -54,6 +55,7 @@ static const struct
 static void
 init (void)
 {
+  int saved_errno = errno;
   FILE *fp = fopen (default_nss, "rc");
   if (fp != NULL)
     {
@@ -111,6 +113,7 @@ init (void)
 
       fclose (fp);
     }
+  __set_errno (saved_errno);
 }