diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 15:43:37 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 15:43:37 +0000 |
commit | 99912ca733dd960f5589227fd999c86e73c8e894 (patch) | |
tree | 9df947fc08884d498cf76a02204d74b121064134 /coreutils/pwd.c | |
parent | ff131b980d524a33d8a43cefe65e14f64a43f2da (diff) | |
download | busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.gz busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.bz2 busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.zip |
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.c | 7 |
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 | |||
14 | int pwd_main(int argc, char **argv); | 14 | int pwd_main(int argc, char **argv); |
15 | int pwd_main(int argc, char **argv) | 15 | int 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; |