1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
* nss/getXXent_r.c: Correctly handle failing setXXent function.
This commit is contained in:
Ulrich Drepper
1998-03-29 22:56:22 +00:00
parent b0081e6c10
commit 7503605ecc
2 changed files with 20 additions and 21 deletions

View File

@ -1,5 +1,7 @@
1998-03-29 Ulrich Drepper <drepper@cygnus.com> 1998-03-29 Ulrich Drepper <drepper@cygnus.com>
* nss/getXXent_r.c: Correctly handle failing setXXent function.
* inet/netinet/in.h: Use cast to uint32_t in IPv4 macros. * inet/netinet/in.h: Use cast to uint32_t in IPv4 macros.
Reported by Andreas Jaeger. Reported by Andreas Jaeger.

View File

@ -261,32 +261,29 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen,
&& errno == ERANGE) && errno == ERANGE)
break; break;
no_more = __nss_next (&nip, GETFUNC_NAME_STRING, (void **) &fct, do
status, 0); {
no_more = __nss_next (&nip, GETFUNC_NAME_STRING, (void **) &fct,
status, 0);
if (is_last_nip) if (is_last_nip)
last_nip = nip; last_nip = nip;
if (! no_more && current_nip != nip) if (! no_more)
/* Call the `setXXent' function. This wasn't done before. */ {
do /* Call the `setXXent' function. This wasn't done before. */
{ set_function sfct;
set_function sfct;
no_more = __nss_lookup (&nip, SETFUNC_NAME_STRING, no_more = __nss_lookup (&nip, SETFUNC_NAME_STRING,
(void **) &sfct); (void **) &sfct);
if (! no_more) if (! no_more)
status = (*sfct) (STAYOPEN_TMPVAR); status = (*sfct) (STAYOPEN_TMPVAR);
else else
{
status = NSS_STATUS_NOTFOUND; 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); __libc_lock_unlock (lock);