Errors count to rmdir
This commit is contained in:
parent
9077404b75
commit
83af9b4735
|
@ -3,13 +3,19 @@
|
|||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
int errors = 0;
|
||||
for(int i = 1; i<argc;i++)
|
||||
{
|
||||
int fd = rmdir(argv[i]); /* Is it actually a file descriptor? */
|
||||
if(fd == -1)
|
||||
{
|
||||
fprintf(stderr,"Error removing dir %s\n",argv[i]);
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
if(errors>0)
|
||||
{
|
||||
printf("%i error(s) found\n",errors);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue