aboutsummaryrefslogtreecommitdiff
path: root/coreutils/whoami.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 15:43:37 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 15:43:37 +0000
commit99912ca733dd960f5589227fd999c86e73c8e894 (patch)
tree9df947fc08884d498cf76a02204d74b121064134 /coreutils/whoami.c
parentff131b980d524a33d8a43cefe65e14f64a43f2da (diff)
downloadbusybox-99912ca733dd960f5589227fd999c86e73c8e894.tar.gz
audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
Diffstat (limited to 'coreutils/whoami.c')
-rw-r--r--coreutils/whoami.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 3185817b6..25757f633 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -9,11 +9,10 @@
/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
#include "busybox.h"
+/* This is a NOFORK applet. Be very careful! */
+
int whoami_main(int argc, char **argv);
int whoami_main(int argc, char **argv)
{
@@ -21,6 +20,6 @@ int whoami_main(int argc, char **argv)
bb_show_usage();
puts(bb_getpwuid(NULL, geteuid(), -1));
- /* exits on error */
- fflush_stdout_and_exit(EXIT_SUCCESS);
+
+ return fflush(stdout);
}