diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-10-07 23:46:22 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-10-07 23:46:22 +0000 |
commit | e2aa1f4fa9a36d223e271cc24dfad691f6a56d12 (patch) | |
tree | ff7678cf744386be5015ae0385a83410ddaca4d9 /libc/pwd_grp/getpwnam.c | |
parent | 59030d6f8ae481f69966aa9e1062af461b50e1b0 (diff) |
Formatting update
Diffstat (limited to 'libc/pwd_grp/getpwnam.c')
-rw-r--r-- | libc/pwd_grp/getpwnam.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/libc/pwd_grp/getpwnam.c b/libc/pwd_grp/getpwnam.c index 85dbc8ed8..63671927b 100644 --- a/libc/pwd_grp/getpwnam.c +++ b/libc/pwd_grp/getpwnam.c @@ -25,28 +25,25 @@ #include <pwd.h> -struct passwd * -getpwnam(const char * name) +struct passwd *getpwnam(const char *name) { - int passwd_fd; - struct passwd * passwd; + int passwd_fd; + struct passwd *passwd; - if (name==NULL) - { - errno=EINVAL; - return NULL; - } + if (name == NULL) { + errno = EINVAL; + return NULL; + } - if ((passwd_fd=open("/etc/passwd", O_RDONLY))<0) - return NULL; + if ((passwd_fd = open("/etc/passwd", O_RDONLY)) < 0) + return NULL; - while ((passwd=__getpwent(passwd_fd))!=NULL) - if (!strcmp(passwd->pw_name, name)) - { - close(passwd_fd); - return passwd; - } + while ((passwd = __getpwent(passwd_fd)) != NULL) + if (!strcmp(passwd->pw_name, name)) { + close(passwd_fd); + return passwd; + } - close(passwd_fd); - return NULL; + close(passwd_fd); + return NULL; } |