X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=whoami.c;h=6a5dd2c04ef9b5bfe37ce5bd252b41ee80ef1cec;hb=46f44d24fcc25a5d6e13e0453485881bdf147e91;hp=da584790d83e1e5c4ccc33263acf0084f5f50c3d;hpb=7ab9c7ee52db8759d457819f5480378fa3aa97cc;p=oweals%2Fbusybox.git diff --git a/whoami.c b/whoami.c index da584790d..6a5dd2c04 100644 --- a/whoami.c +++ b/whoami.c @@ -20,16 +20,10 @@ * */ -#include "internal.h" +#include "busybox.h" #include #include -static const char whoami_usage[] = "whoami\n" -#ifndef BB_FEATURE_TRIVIAL_HELP - "\nPrints the user name associated with the current effective user id.\n" -#endif - ; - extern int whoami_main(int argc, char **argv) { char *user = xmalloc(9); @@ -41,9 +35,7 @@ extern int whoami_main(int argc, char **argv) my_getpwuid(user, uid); if (user) { puts(user); - exit(TRUE); + return EXIT_SUCCESS; } - fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0], - (unsigned) uid); - exit(FALSE); + error_msg_and_die("cannot find username for UID %u\n", (unsigned) uid); }