Merge branch 'elf-move'
[platform/upstream/glibc.git] / grp / initgroups.c
index 48119ff..62fd1fc 100644 (file)
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <alloca.h>
 #include <assert.h>
@@ -82,9 +81,8 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
 
   if (__nss_initgroups_database == NULL)
     {
-      no_more = __nss_database_lookup ("initgroups", NULL, "",
-                                      &__nss_initgroups_database);
-      if (no_more == 0 && __nss_initgroups_database == NULL)
+      if (__nss_database_lookup ("initgroups", NULL, "",
+                                &__nss_initgroups_database) < 0)
        {
          if (__nss_group_database == NULL)
            no_more = __nss_database_lookup ("group", NULL, "compat files",
@@ -92,11 +90,8 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
 
          __nss_initgroups_database = __nss_group_database;
        }
-      else if (__nss_initgroups_database != NULL)
-       {
-         assert (no_more == 0);
-         use_initgroups_entry = true;
-       }
+      else
+       use_initgroups_entry = true;
     }
   else
     /* __nss_initgroups_database might have been set through