summaryrefslogtreecommitdiff
path: root/libc/pwd_grp/getpwuid.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/getpwuid.c
parent59030d6f8ae481f69966aa9e1062af461b50e1b0 (diff)
Formatting update
Diffstat (limited to 'libc/pwd_grp/getpwuid.c')
-rw-r--r--libc/pwd_grp/getpwuid.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/libc/pwd_grp/getpwuid.c b/libc/pwd_grp/getpwuid.c
index ffd58c1f0..1cd0d691c 100644
--- a/libc/pwd_grp/getpwuid.c
+++ b/libc/pwd_grp/getpwuid.c
@@ -23,22 +23,20 @@
#include <fcntl.h>
#include <pwd.h>
-struct passwd *
-getpwuid(uid_t uid)
+struct passwd *getpwuid(uid_t uid)
{
- int passwd_fd;
- struct passwd * passwd;
+ int passwd_fd;
+ struct passwd *passwd;
- 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 (passwd->pw_uid==uid)
- {
- close(passwd_fd);
- return passwd;
- }
+ while ((passwd = __getpwent(passwd_fd)) != NULL)
+ if (passwd->pw_uid == uid) {
+ close(passwd_fd);
+ return passwd;
+ }
- close (passwd_fd);
- return NULL;
+ close(passwd_fd);
+ return NULL;
}