platform_system_core/toolbox/rmdir.c
Mark Salyzyn aa907768af toolbox: turn on -Werror
- Deal with some signedness issues
- Deal with some size issues
- Deal with NULL pointer issues
- Deal with some -Wunused issues

Change-Id: I1479dd90d690084491bae3475f2c547833519a57
2014-05-14 12:41:24 -07:00

28 lines
500 B
C

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
static int usage()
{
fprintf(stderr,"rmdir <directory>\n");
return -1;
}
int rmdir_main(int argc, char *argv[])
{
int ret;
if(argc < 2) return usage();
while(argc > 1) {
argc--;
argv++;
ret = rmdir(argv[0]);
if(ret < 0) {
fprintf(stderr, "rmdir failed for %s, %s\n", argv[0], strerror(errno));
return ret;
}
}
return 0;
}