Support for tar -z option for uncompressing only
[oweals/busybox.git] / whoami.c
index da584790d83e1e5c4ccc33263acf0084f5f50c3d..6a5dd2c04ef9b5bfe37ce5bd252b41ee80ef1cec 100644 (file)
--- a/whoami.c
+++ b/whoami.c
  *
  */
 
-#include "internal.h"
+#include "busybox.h"
 #include <stdio.h>
 #include <pwd.h>
 
-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);
 }