Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-12-05 08:11:41 +0300
committerMatt Kraai <kraai@debian.org>2000-12-05 08:11:41 +0300
commitd27753afd983ffeae45b80dee92f02d0518ca7bf (patch)
tree1ecefa6dc73279cfe4ae3a45cc647823094248f0 /coreutils/rm.c
parent0e836ed8db86ef0274510c27e173f7ac66c6b2a6 (diff)
Use perrorMsg instead of perror and keep removing files if we encounter
an error.
Diffstat (limited to 'coreutils/rm.c')
-rw-r--r--coreutils/rm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/coreutils/rm.c b/coreutils/rm.c
index c62083e9b..566335158 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -37,7 +37,7 @@ static const char *srcName;
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (unlink(fileName) < 0) {
- perror(fileName);
+ perrorMsg("%s", fileName);
return (FALSE);
}
return (TRUE);
@@ -47,11 +47,11 @@ static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (recursiveFlag == FALSE) {
errno = EISDIR;
- perror(fileName);
+ perrorMsg("%s", fileName);
return (FALSE);
}
if (rmdir(fileName) < 0) {
- perror(fileName);
+ perrorMsg("%s", fileName);
return (FALSE);
}
return (TRUE);
@@ -59,6 +59,7 @@ static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
extern int rm_main(int argc, char **argv)
{
+ int status = EXIT_SUCCESS;
int stopIt=FALSE;
struct stat statbuf;
@@ -102,9 +103,9 @@ extern int rm_main(int argc, char **argv)
} else {
if (recursiveAction(srcName, recursiveFlag, FALSE,
TRUE, fileAction, dirAction, NULL) == FALSE) {
- return EXIT_FAILURE;
+ status = EXIT_FAILURE;
}
}
}
- return EXIT_SUCCESS;
+ return status;
}