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 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <stdio.h>
11#include <stdlib.h>
12#include "busybox.h" 10#include "busybox.h"
13 11
12/* This is a NOFORK applet. Be very careful! */
13
14int pwd_main(int argc, char **argv); 14int pwd_main(int argc, char **argv);
15int pwd_main(int argc, char **argv) 15int pwd_main(int argc, char **argv)
16{ 16{
@@ -19,7 +19,8 @@ int pwd_main(int argc, char **argv)
19 buf = xrealloc_getcwd_or_warn(NULL); 19 buf = xrealloc_getcwd_or_warn(NULL);
20 if (buf != NULL) { 20 if (buf != NULL) {
21 puts(buf); 21 puts(buf);
22 fflush_stdout_and_exit(EXIT_SUCCESS); 22 free(buf);
23 return fflush(stdout);
23 } 24 }
24 25
25 return EXIT_FAILURE; 26 return EXIT_FAILURE;