summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'toolbox/rmdir.c')
-rw-r--r--toolbox/rmdir.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/toolbox/rmdir.c b/toolbox/rmdir.c
new file mode 100644
index 000000000..06f3df26c
--- /dev/null
+++ b/toolbox/rmdir.c
@@ -0,0 +1,29 @@
1#include <stdio.h>
2#include <unistd.h>
3#include <string.h>
4#include <errno.h>
5
6static int usage()
7{
8 fprintf(stderr,"rmdir <directory>\n");
9 return -1;
10}
11
12int rmdir_main(int argc, char *argv[])
13{
14 int symbolic = 0;
15 int ret;
16 if(argc < 2) return usage();
17
18 while(argc > 1) {
19 argc--;
20 argv++;
21 ret = rmdir(argv[0]);
22 if(ret < 0) {
23 fprintf(stderr, "rmdir failed for %s, %s\n", argv[0], strerror(errno));
24 return ret;
25 }
26 }
27
28 return 0;
29}