]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix NSS_STATUS_TRYAGAIN handling.
authorUlrich Drepper <drepper@redhat.com>
Fri, 30 Jan 1998 17:13:04 +0000 (17:13 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 30 Jan 1998 17:13:04 +0000 (17:13 +0000)
nss/getXXbyYY_r.c
nss/getXXent_r.c

index 18f0bae03aa4a7924ab4df5a73f32e753c4af75c..13a6426dfb55e53f8060c00badf023c46b9c0933 100644 (file)
@@ -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.
 
@@ -130,6 +130,13 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
   while (no_more == 0)
     {
       status = (*fct) (ADD_VARIABLES, resbuf, buffer, buflen H_ERRNO_VAR);
+      if (status == NSS_STATUS_TRYAGAIN)
+       {
+         /* XXX This is very wrong but there is no fast soluation in sight.
+            Give the previous module a chance to complete it's
+            operation before errno will be reset by the next call */
+         break;
+       }
 
       no_more = __nss_next (&nip, REENTRANT_NAME_STRING,
                            (void **) &fct, status, 0);
index 1df51ab768a531bf297dc84e891d7853d60e8ca7..b43463b11d83e3f87ca451b37962b4f31b0e8fd7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -245,6 +245,13 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen,
       service_user *current_nip = nip;
 
       status = (*fct) (resbuf, buffer, buflen H_ERRNO_VAR);
+      if (status == NSS_STATUS_TRYAGAIN)
+       {
+         /* XXX This is very wrong but there is no fast solution in sight.
+            Give the previous module a chance to complete it's
+            operation before errno will be reset by the next call */
+         break;
+       }
 
       no_more = __nss_next (&nip, GETFUNC_NAME_STRING, (void **) &fct,
                            status, 0);