aboutsummaryrefslogtreecommitdiff
path: root/coreutils/pwd.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/pwd.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/pwd.c')
-rw-r--r--coreutils/pwd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/coreutils/pwd.c b/coreutils/pwd.c
index d96f6a8e5..a93b8f115 100644
--- a/coreutils/pwd.c
+++ b/coreutils/pwd.c
@@ -7,10 +7,10 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include "busybox.h"
+/* This is a NOFORK applet. Be very careful! */
+
int pwd_main(int argc, char **argv);
int pwd_main(int argc, char **argv)
{
@@ -19,7 +19,8 @@ int pwd_main(int argc, char **argv)
buf = xrealloc_getcwd_or_warn(NULL);
if (buf != NULL) {
puts(buf);
- fflush_stdout_and_exit(EXIT_SUCCESS);
+ free(buf);
+ return fflush(stdout);
}
return EXIT_FAILURE;