From 99912ca733dd960f5589227fd999c86e73c8e894 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 10 Apr 2007 15:43:37 +0000 Subject: audit small applets and mark some of them as NOFORK. Put big scary warnings in relevant places. --- coreutils/pwd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'coreutils/pwd.c') 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 -#include #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; -- cgit v1.2.3