commit 83af9b4735a32c16bf1373866b85a4ee87faae98
parent 9077404b75bc80a529814dd23c2be6f84d4c8f65
Author: qorg11 <qorg@vxempire.xyz>
Date: Mon, 1 Jun 2020 22:47:58 +0200
Errors count to rmdir
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/rmdir.c b/src/rmdir.c
@@ -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]);
- }
+ fprintf(stderr,"Error removing dir %s\n",argv[i]);
+ errors++;
+ }
+ }
+ if(errors>0)
+ {
+ printf("%i error(s) found\n",errors);
}
return 0;
}