summaryrefslogtreecommitdiff
path: root/nss/getXXent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-29 22:56:22 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-29 22:56:22 +0000
commit7503605ecc29a2203d856ef71f4b84f27fa1093c (patch)
tree1d066b75cded43673d223bdb2aa8426b6099125c /nss/getXXent_r.c
parentb0081e6c104679b374e7b7154c187fb48428c672 (diff)
downloadglibc-7503605ecc29a2203d856ef71f4b84f27fa1093c.tar.gz
Update.
* nss/getXXent_r.c: Correctly handle failing setXXent function.
Diffstat (limited to 'nss/getXXent_r.c')
-rw-r--r--nss/getXXent_r.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/nss/getXXent_r.c b/nss/getXXent_r.c
index b709a4a935..1d27cfc66a 100644
--- a/nss/getXXent_r.c
+++ b/nss/getXXent_r.c
@@ -261,32 +261,29 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen,
&& errno == ERANGE)
break;
- no_more = __nss_next (&nip, GETFUNC_NAME_STRING, (void **) &fct,
- status, 0);
+ do
+ {
+ no_more = __nss_next (&nip, GETFUNC_NAME_STRING, (void **) &fct,
+ status, 0);
- if (is_last_nip)
- last_nip = nip;
+ if (is_last_nip)
+ last_nip = nip;
- if (! no_more && current_nip != nip)
- /* Call the `setXXent' function. This wasn't done before. */
- do
- {
- set_function sfct;
+ if (! no_more)
+ {
+ /* Call the `setXXent' function. This wasn't done before. */
+ set_function sfct;
- no_more = __nss_lookup (&nip, SETFUNC_NAME_STRING,
- (void **) &sfct);
+ no_more = __nss_lookup (&nip, SETFUNC_NAME_STRING,
+ (void **) &sfct);
- if (! no_more)
- status = (*sfct) (STAYOPEN_TMPVAR);
- else
- {
+ if (! no_more)
+ status = (*sfct) (STAYOPEN_TMPVAR);
+ else
status = NSS_STATUS_NOTFOUND;
- if (no_more == 1)
- /* There is no more module to search. */
- break;
- }
- }
- while (! no_more && status != NSS_STATUS_SUCCESS);
+ }
+ }
+ while (! no_more && status != NSS_STATUS_SUCCESS);
}
__libc_lock_unlock (lock);