diff options
author | Matt Kraai | 2000-11-22 01:09:38 +0000 |
---|---|---|
committer | Matt Kraai | 2000-11-22 01:09:38 +0000 |
commit | 9a71af54f53332dda41823763d2ea85a4afdf2e0 (patch) | |
tree | b84bec29f565fdb0033173043c8bda6fa9f1b597 | |
parent | ab8f9e286b15e043099d5b28b650e57823f8d273 (diff) | |
download | busybox-9a71af54f53332dda41823763d2ea85a4afdf2e0.zip busybox-9a71af54f53332dda41823763d2ea85a4afdf2e0.tar.gz |
Fix behavior when removal fails.
-rw-r--r-- | coreutils/rmdir.c | 8 | ||||
-rw-r--r-- | rmdir.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 14ebf92..dfe53b2 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c @@ -28,14 +28,16 @@ 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; } @@ -28,14 +28,16 @@ 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; } |