about summary refs log tree commit diff
path: root/nis/nss_nis/nis-rpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-rpc.c')
-rw-r--r--nis/nss_nis/nis-rpc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/nis/nss_nis/nis-rpc.c b/nis/nss_nis/nis-rpc.c
index 073284865e..cd1f0db9b5 100644
--- a/nis/nss_nis/nis-rpc.c
+++ b/nis/nss_nis/nis-rpc.c
@@ -169,13 +169,12 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
       if (data->next == NULL)
         return NSS_STATUS_NOTFOUND;
       p = strcpy (buffer, data->next->val);
-      data->next = data->next->next;
       while (isspace (*p))
         ++p;
 
-      parse_res = _nss_files_parse_rpcent (p, rpc, pdata, buflen);
-      if (!parse_res && errno == ERANGE)
+      if ((parse_res = _nss_files_parse_rpcent (p, rpc, pdata, buflen)) == -1)
 	return NSS_STATUS_TRYAGAIN;
+      data->next = data->next->next;
     }
   while (!parse_res);
 
@@ -286,9 +285,9 @@ _nss_nis_getrpcbynumber_r (int number, struct rpcent *rpc,
 
   parse_res = _nss_files_parse_rpcent (p, rpc, data, buflen);
 
-  if (!parse_res)
+  if (parse_res < 1)
     {
-      if (errno == ERANGE)
+      if (parse_res == -1)
 	return NSS_STATUS_TRYAGAIN;
       else
 	return NSS_STATUS_NOTFOUND;