about summary refs log tree commit diff
path: root/nis/nss_nisplus/nisplus-ethers.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nisplus/nisplus-ethers.c')
-rw-r--r--nis/nss_nisplus/nisplus-ethers.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nis/nss_nisplus/nisplus-ethers.c b/nis/nss_nisplus/nisplus-ethers.c
index 94b433abd2..2fd152dfdb 100644
--- a/nis/nss_nisplus/nisplus-ethers.c
+++ b/nis/nss_nisplus/nisplus-ethers.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
 
@@ -231,6 +231,7 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
     {
       nis_result *result;
       char buf[strlen (name) + 40 + tablename_len];
+      int olderr = errno;
 
       sprintf (buf, "[name=%s],%s", name, tablename_val);
 
@@ -247,6 +248,8 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
 					       buflen, errnop);
       if (parse_res < 1)
 	{
+	  __set_errno (olderr);
+
 	  if (parse_res == -1)
 	    {
 	      nis_freeresult (result);