aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/id.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/toys/posix/id.c b/toys/posix/id.c
index f40f6c1b..8b68d4de 100644
--- a/toys/posix/id.c
+++ b/toys/posix/id.c
@@ -67,12 +67,10 @@ void do_id(char *username)
// check if a username is given
if (username) {
- if (!(pw = getpwnam(username)))
- error_exit("no such user '%s'", username);
+ pw = xgetpwnam(username);
uid = euid = pw->pw_uid;
gid = egid = pw->pw_gid;
- if (cmd_groups)
- printf("%s : ", pw->pw_name);
+ if (cmd_groups) printf("%s : ", pw->pw_name);
}
i = flags & FLAG_r;