about summary refs log tree commit diff
path: root/nis/nss_nis/nis-ethers.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-ethers.c')
-rw-r--r--nis/nss_nis/nis-ethers.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/nis/nss_nis/nis-ethers.c b/nis/nss_nis/nis-ethers.c
index cbc37591ee..a5723747fc 100644
--- a/nis/nss_nis/nis-ethers.c
+++ b/nis/nss_nis/nis-ethers.c
@@ -200,7 +200,7 @@ _nss_nis_gethostton_r (const char *name, struct ether *eth,
 
   if (name == NULL)
     {
-      __set_errno (EINVAL);
+      *errnop = EINVAL;
       return NSS_STATUS_UNAVAIL;
     }
 
@@ -231,13 +231,14 @@ _nss_nis_gethostton_r (const char *name, struct ether *eth,
   free (result);
 
   parse_res = _nss_files_parse_etherent (p, eth, data, buflen, errnop);
-  if (parse_res == -1)
-    return NSS_STATUS_TRYAGAIN;
-
-  if (!parse_res)
-    return NSS_STATUS_NOTFOUND;
-  else
-    return NSS_STATUS_SUCCESS;
+  if (parse_res < 1)
+    {
+      if (parse_res == -1)
+	return NSS_STATUS_TRYAGAIN;
+      else
+	return NSS_STATUS_NOTFOUND;
+    }
+  return NSS_STATUS_SUCCESS;
 }
 
 enum nss_status
@@ -252,7 +253,7 @@ _nss_nis_getntohost_r (struct ether_addr *addr, struct ether *eth,
 
   if (addr == NULL)
     {
-      __set_errno (EINVAL);
+      *errnop = EINVAL;
       return NSS_STATUS_UNAVAIL;
     }
 
@@ -291,11 +292,12 @@ _nss_nis_getntohost_r (struct ether_addr *addr, struct ether *eth,
   free (result);
 
   parse_res = _nss_files_parse_etherent (p, eth, data, buflen, errnop);
-  if (parse_res == -1)
-    return NSS_STATUS_TRYAGAIN;
-
-  if (!parse_res)
-    return NSS_STATUS_NOTFOUND;
-  else
-    return NSS_STATUS_SUCCESS;
+  if (parse_res < 1)
+    {
+      if (parse_res == -1)
+	return NSS_STATUS_TRYAGAIN;
+      else
+	return NSS_STATUS_NOTFOUND;
+    }
+  return NSS_STATUS_SUCCESS;
 }