mirror of https://git.qorg11.net/k9core.git
Fixed stuff in rmdir
This commit is contained in:
parent
74047ab07f
commit
96d5493476
21
src/rmdir.c
21
src/rmdir.c
|
@ -2,18 +2,17 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
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: %i = %s\n",argv[i],
|
||||
errno,strerror(errno));
|
||||
errors++;
|
||||
|
||||
for(int i = 1; i<argc;i++)
|
||||
{
|
||||
if(rmdir(argv[i]))
|
||||
{
|
||||
fprintf(stderr,"rmdir: failed to remove '%s', %s\n",
|
||||
argv[i],strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue