Fix behavior when removal fails.
authorMatt Kraai <kraai@debian.org>
Wed, 22 Nov 2000 01:09:38 +0000 (01:09 -0000)
committerMatt Kraai <kraai@debian.org>
Wed, 22 Nov 2000 01:09:38 +0000 (01:09 -0000)
coreutils/rmdir.c
rmdir.c

index 14ebf92c5263184d71d4c494c2cc1a9f234de818..dfe53b21508b6cfe34049bb79baacb5ad278e68d 100644 (file)
 
 extern int rmdir_main(int argc, char **argv)
 {
+       int status = EXIT_SUCCESS;
+
        if (argc == 1 || **(argv + 1) == '-')
                usage(rmdir_usage);
 
        while (--argc > 0) {
                if (rmdir(*(++argv)) == -1) {
-                       errorMsg("%s\n", strerror(errno));
-                       exit(FALSE);
+                       perrorMsg("%s", *argv);
+                       status = EXIT_FAILURE;
                }
        }
-       return(TRUE);
+       return status;
 }
diff --git a/rmdir.c b/rmdir.c
index 14ebf92c5263184d71d4c494c2cc1a9f234de818..dfe53b21508b6cfe34049bb79baacb5ad278e68d 100644 (file)
--- a/rmdir.c
+++ b/rmdir.c
 
 extern int rmdir_main(int argc, char **argv)
 {
+       int status = EXIT_SUCCESS;
+
        if (argc == 1 || **(argv + 1) == '-')
                usage(rmdir_usage);
 
        while (--argc > 0) {
                if (rmdir(*(++argv)) == -1) {
-                       errorMsg("%s\n", strerror(errno));
-                       exit(FALSE);
+                       perrorMsg("%s", *argv);
+                       status = EXIT_FAILURE;
                }
        }
-       return(TRUE);
+       return status;
 }