blob: 06f3df26cf247f4f9ee91be1c5f9d51c8b2e8227 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001#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}