summaryrefslogtreecommitdiff
path: root/libc/pwd_grp/getgrgid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/pwd_grp/getgrgid.c')
-rw-r--r--libc/pwd_grp/getgrgid.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/libc/pwd_grp/getgrgid.c b/libc/pwd_grp/getgrgid.c
index c1dd20e35..fa74a9644 100644
--- a/libc/pwd_grp/getgrgid.c
+++ b/libc/pwd_grp/getgrgid.c
@@ -23,26 +23,20 @@
#include <fcntl.h>
#include <grp.h>
-struct group *
-getgrgid(const gid_t gid)
+struct group *getgrgid(const gid_t gid)
{
- struct group * group;
- int grp_fd;
+ struct group *group;
+ int grp_fd;
- if ((grp_fd=open("/etc/group", O_RDONLY))<0)
- return NULL;
+ if ((grp_fd = open("/etc/group", O_RDONLY)) < 0)
+ return NULL;
- while ((group=__getgrent(grp_fd))!=NULL)
- if (group->gr_gid==gid)
- {
- close(grp_fd);
- return group;
- }
+ while ((group = __getgrent(grp_fd)) != NULL)
+ if (group->gr_gid == gid) {
+ close(grp_fd);
+ return group;
+ }
- close(grp_fd);
- return NULL;
+ close(grp_fd);
+ return NULL;
}
-
-
-
-