summaryrefslogtreecommitdiff
path: root/nss/getXXent_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/getXXent_r.c')
-rw-r--r--nss/getXXent_r.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/nss/getXXent_r.c b/nss/getXXent_r.c
index 1884b0773d..aa21b6fe7c 100644
--- a/nss/getXXent_r.c
+++ b/nss/getXXent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -249,6 +249,18 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen,
status = (*fct) (resbuf, buffer, buflen, __errno_location ()
H_ERRNO_VAR);
+ /* The the status is NSS_STATUS_TRYAGAIN and errno is ERANGE the
+ provided buffer is too small. In this case we should give
+ the user the possibility to enlarge the buffer and we should
+ not simply go on with the next service (even if the TRYAGAIN
+ action tells us so). */
+ if (status == NSS_STATUS_TRYAGAIN
+#ifdef NEED_H_ERRNO
+ && *h_errnop == NETDB_INTERNAL
+#endif
+ && errno == ERANGE)
+ break;
+
no_more = __nss_next (&nip, GETFUNC_NAME_STRING, (void **) &fct,
status, 0);