aboutsummaryrefslogtreecommitdiff
path: root/inet/getnetgrent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-09-25 22:55:11 +0000
committerUlrich Drepper <drepper@redhat.com>2005-09-25 22:55:11 +0000
commit9c5a79048766f0ac89aa84ad0c9a2f6e6dffec17 (patch)
tree7216456790ead0f00fb02de81dcaebf2015dd3ac /inet/getnetgrent_r.c
parentc1e3681907d81f8738bdcb3582f6a563e65b6f11 (diff)
downloadglibc-9c5a79048766f0ac89aa84ad0c9a2f6e6dffec17.zip
glibc-9c5a79048766f0ac89aa84ad0c9a2f6e6dffec17.tar.gz
glibc-9c5a79048766f0ac89aa84ad0c9a2f6e6dffec17.tar.bz2
* inet/getnetgrent_r.c (innetgr): Call endfct even if result != 0.
Return 1 only if result == 1. Patch by Benoit Capelle.
Diffstat (limited to 'inet/getnetgrent_r.c')
-rw-r--r--inet/getnetgrent_r.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/inet/getnetgrent_r.c b/inet/getnetgrent_r.c
index 4dbccd9..97b2b80 100644
--- a/inet/getnetgrent_r.c
+++ b/inet/getnetgrent_r.c
@@ -409,9 +409,6 @@ innetgr (const char *netgroup, const char *host, const char *user,
}
}
- if (result != 0)
- break;
-
/* If we found one service which does know the given
netgroup we don't try further. */
status = NSS_STATUS_RETURN;
@@ -422,6 +419,9 @@ innetgr (const char *netgroup, const char *host, const char *user,
if (endfct != NULL)
(*endfct) (&entry);
+ if (result != 0)
+ break;
+
/* Look for the next service. */
no_more = __nss_next (&entry.nip, "setnetgrent",
&setfct.ptr, status, 0);
@@ -444,6 +444,6 @@ innetgr (const char *netgroup, const char *host, const char *user,
/* Free the memory. */
free_memory (&entry);
- return result;
+ return result == 1;
}
libc_hidden_def (innetgr)