X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fpasswd%2Fgetgrouplist.c;h=43e518245f8e6bfdafdbdb2ff5aec92a247798e4;hb=e98a54643ee95032baab883673628314e520012e;hp=0fddc9a148bd3e910dcf5e52033ba064dee60423;hpb=2894a44b40e460fc4112988407818439f2e9672d;p=musl diff --git a/src/passwd/getgrouplist.c b/src/passwd/getgrouplist.c index 0fddc9a1..43e51824 100644 --- a/src/passwd/getgrouplist.c +++ b/src/passwd/getgrouplist.c @@ -28,7 +28,7 @@ int getgrouplist(const char *user, gid_t gid, gid_t *groups, int *ngroups) f = __nscd_query(GETINITGR, user, resp, sizeof resp, &swap); if (!f) goto cleanup; - if (f != (FILE*)-1 && resp[INITGRFOUND]) { + if (resp[INITGRFOUND]) { nscdbuf = calloc(resp[INITGRNGRPS], sizeof(uint32_t)); if (!nscdbuf) goto cleanup; if (!fread(nscdbuf, sizeof(*nscdbuf)*resp[INITGRNGRPS], 1, f)) { @@ -40,7 +40,7 @@ int getgrouplist(const char *user, gid_t gid, gid_t *groups, int *ngroups) nscdbuf[i] = bswap_32(nscdbuf[i]); } } - if (f != (FILE*)-1) fclose(f); + fclose(f); f = fopen("/etc/group", "rbe"); if (!f && errno != ENOENT && errno != ENOTDIR)