about summary refs log tree commit diff
path: root/nis/nss_nis/nis-proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-proto.c')
-rw-r--r--nis/nss_nis/nis-proto.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/nis/nss_nis/nis-proto.c b/nis/nss_nis/nis-proto.c
index 3af0f4e896..e65bfa7c8d 100644
--- a/nis/nss_nis/nis-proto.c
+++ b/nis/nss_nis/nis-proto.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -150,7 +150,10 @@ internal_nis_getprotoent_r (struct protoent *proto,
       char *p;
 
       if (next == NULL)
-        return NSS_STATUS_NOTFOUND;
+	{
+	  *errnop = ENOENT;
+	  return NSS_STATUS_NOTFOUND;
+	}
       p = strncpy (buffer, next->val, buflen);
 
       while (isspace (*p))
@@ -204,7 +207,9 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
 
   if (retval != NSS_STATUS_SUCCESS)
     {
-      if (retval == NSS_STATUS_TRYAGAIN)
+      if (retval == NSS_STATUS_NOTFOUND)
+	*errnop = ENOENT;
+      else if (retval == NSS_STATUS_TRYAGAIN)
 	*errnop = errno;
       return retval;
     }
@@ -228,7 +233,10 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
       if (parse_res == -1)
 	return NSS_STATUS_TRYAGAIN;
       else
-	return NSS_STATUS_NOTFOUND;
+	{
+	  *errnop = ENOENT;
+	  return NSS_STATUS_NOTFOUND;
+	}
     }
   return NSS_STATUS_SUCCESS;
 }
@@ -253,7 +261,9 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
 
   if (retval != NSS_STATUS_SUCCESS)
     {
-      if (retval == NSS_STATUS_TRYAGAIN)
+      if (retval == NSS_STATUS_NOTFOUND)
+	*errnop = ENOENT;
+      else if (retval == NSS_STATUS_TRYAGAIN)
 	*errnop = errno;
       return retval;
     }
@@ -277,7 +287,10 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
       if (parse_res == -1)
 	return NSS_STATUS_TRYAGAIN;
       else
-	return NSS_STATUS_NOTFOUND;
+	{
+	  *errnop = ENOENT;
+	  return NSS_STATUS_NOTFOUND;
+	}
     }
   return NSS_STATUS_SUCCESS;
 }