From 61cfe8da75561d924581cd24b44e5d38a215fb41 Mon Sep 17 00:00:00 2001 From: kraai Date: Wed, 22 Nov 2000 01:09:38 +0000 Subject: Fix behavior when removal fails. git-svn-id: svn://busybox.net/trunk/busybox@1338 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- coreutils/rmdir.c | 8 +++++--- rmdir.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 14ebf92c5..dfe53b215 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; } diff --git a/rmdir.c b/rmdir.c index 14ebf92c5..dfe53b215 100644 --- a/rmdir.c +++ b/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; } -- cgit v1.2.3-55-g6feb