about summary refs log tree commit diff
path: root/nis/nss_nis/nis-alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-alias.c')
-rw-r--r--nis/nss_nis/nis-alias.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/nis/nss_nis/nis-alias.c b/nis/nss_nis/nis-alias.c
index 0d0294082d..6ef23012b8 100644
--- a/nis/nss_nis/nis-alias.c
+++ b/nis/nss_nis/nis-alias.c
@@ -231,7 +231,7 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
 
   if (name == NULL)
     {
-      __set_errno (EINVAL);
+      *errnop = EINVAL;
       return NSS_STATUS_UNAVAIL;
     }
 
@@ -262,11 +262,13 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
 
   alias->alias_local = 0;
   parse_res = _nss_nis_parse_aliasent (name, p, alias, buffer, buflen, errnop);
-  if (parse_res == -1)
-    return NSS_STATUS_TRYAGAIN;
+  if (parse_res < 1)
+    {
+      if (parse_res == -1)
+	return NSS_STATUS_TRYAGAIN;
+      else
+	return NSS_STATUS_NOTFOUND;
+    }
 
-  if (parse_res)
-    return NSS_STATUS_SUCCESS;
-  else
-    return NSS_STATUS_NOTFOUND;
+  return NSS_STATUS_SUCCESS;
 }