diff options
-rw-r--r-- | src/id.c | 5 | ||||
-rw-r--r-- | src/whoami.c | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -245,7 +245,10 @@ main (int argc, char **argv) } } if (pwd == NULL) - error (EXIT_FAILURE, 0, _("%s: no such user"), quote (spec)); + { + error (0, 0, _("%s: no such user"), quote (spec)); + exit (EXIT_FAILURE); + } pw_name = xstrdup (pwd->pw_name); ruid = euid = pwd->pw_uid; rgid = egid = pwd->pw_gid; diff --git a/src/whoami.c b/src/whoami.c index e58c57528..972cd5539 100644 --- a/src/whoami.c +++ b/src/whoami.c @@ -84,8 +84,11 @@ main (int argc, char **argv) uid = geteuid (); pw = (uid == NO_UID && errno ? NULL : getpwuid (uid)); if (!pw) - error (EXIT_FAILURE, errno, _("cannot find name for user ID %lu"), - (unsigned long int) uid); + { + error (0, errno, _("cannot find name for user ID %lu"), + (unsigned long int) uid); + exit (EXIT_FAILURE); + } puts (pw->pw_name); return EXIT_SUCCESS; } |