Change errors in rmdir to warns
This commit is contained in:
parent
9486a5004e
commit
f4e746e87d
|
@ -1,5 +1,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <err.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
|
@ -9,13 +10,13 @@ main(int argc, char *argv[]) {
|
||||||
int fd = rmdir(argv[i]); /* Is it actually a file descriptor? */
|
int fd = rmdir(argv[i]); /* Is it actually a file descriptor? */
|
||||||
if(fd == -1)
|
if(fd == -1)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Error removing dir %s\n",argv[i]);
|
warn("Error removing dir %s\n",argv[i]);
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(errors>0)
|
if(errors>0)
|
||||||
{
|
{
|
||||||
printf("%i error(s) found\n",errors);
|
warn("%i error(s) found\n",errors);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue