aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-11-28 21:06:15 -0600
committerRob Landley <rob@landley.net>2013-11-28 21:06:15 -0600
commit5ec4ab3113dcc813b6040d7ded38e297df99dc0e (patch)
treeafad4e181b9b8ab64496ed7d001c444c245ae429 /toys/posix
parent9e44a5841f0ab9bc03cefb5631c80f3e4e5a60fe (diff)
downloadtoybox-5ec4ab3113dcc813b6040d7ded38e297df99dc0e.tar.gz
Add xgetpwnam() to lib/xwrap.c.
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;