summaryrefslogtreecommitdiffhomepage
path: root/coreutils/rmdir.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/rmdir.c
parentff131b980d524a33d8a43cefe65e14f64a43f2da (diff)
audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
Diffstat (limited to 'coreutils/rmdir.c')
-rw-r--r--coreutils/rmdir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 8cbd6f1fa..7f3253017 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -10,11 +10,12 @@
/* BB_AUDIT SUSv3 compliant */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */
-#include <stdlib.h>
-#include <unistd.h>
#include <libgen.h>
#include "busybox.h"
+/* This is a NOFORK applet. Be very careful! */
+
+
int rmdir_main(int argc, char **argv);
int rmdir_main(int argc, char **argv)
{
@@ -24,7 +25,6 @@ int rmdir_main(int argc, char **argv)
char *path;
flags = getopt32(argc, argv, "p");
-
argv += optind;
if (!*argv) {
@@ -37,7 +37,7 @@ int rmdir_main(int argc, char **argv)
/* Record if the first char was a '.' so we can use dirname later. */
do_dot = (*path == '.');
- do {
+ while (1) {
if (rmdir(path) < 0) {
bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */
status = EXIT_FAILURE;
@@ -53,7 +53,7 @@ int rmdir_main(int argc, char **argv)
}
}
break;
- } while (1);
+ }
} while (*++argv);