If no more module is found don't try to call setXXent functions but
[kopensolaris-gnu/glibc.git] / nss / getXXent_r.c
index aa21b6f..b709a4a 100644 (file)
@@ -279,7 +279,12 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen,
            if (! no_more)
              status = (*sfct) (STAYOPEN_TMPVAR);
            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);
     }