aboutsummaryrefslogtreecommitdiff
path: root/coreutils/pwd.c
diff options
context:
space:
mode:
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;