summaryrefslogtreecommitdiff
path: root/libc/pwd_grp/getgrnam.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-07 23:46:22 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-07 23:46:22 +0000
commite2aa1f4fa9a36d223e271cc24dfad691f6a56d12 (patch)
treeff7678cf744386be5015ae0385a83410ddaca4d9 /libc/pwd_grp/getgrnam.c
parent59030d6f8ae481f69966aa9e1062af461b50e1b0 (diff)
Formatting update
Diffstat (limited to 'libc/pwd_grp/getgrnam.c')
-rw-r--r--libc/pwd_grp/getgrnam.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/libc/pwd_grp/getgrnam.c b/libc/pwd_grp/getgrnam.c
index e6c27fc57..999404284 100644
--- a/libc/pwd_grp/getgrnam.c
+++ b/libc/pwd_grp/getgrnam.c
@@ -24,28 +24,25 @@
#include <fcntl.h>
#include <grp.h>
-struct group *
-getgrnam(const char * name)
+struct group *getgrnam(const char *name)
{
- int grp_fd;
- struct group * group;
+ int grp_fd;
+ struct group *group;
- if (name==NULL)
- {
- errno=EINVAL;
- return NULL;
- }
+ if (name == NULL) {
+ errno = EINVAL;
+ return NULL;
+ }
- 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 (!strcmp(group->gr_name, name))
- {
- close(grp_fd);
- return group;
- }
+ while ((group = __getgrent(grp_fd)) != NULL)
+ if (!strcmp(group->gr_name, name)) {
+ close(grp_fd);
+ return group;
+ }
- close(grp_fd);
- return NULL;
+ close(grp_fd);
+ return NULL;
}