projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support for tar -z option for uncompressing only
[oweals/busybox.git]
/
rm.c
diff --git
a/rm.c
b/rm.c
index c93a94ce10b87a5ad021ac2437049571af556119..a9501ec7f004c23277b5c913c0657c5f1c8da1d2 100644
(file)
--- a/
rm.c
+++ b/
rm.c
@@
-22,7
+22,7
@@
*
*/
*
*/
-#include "
internal
.h"
+#include "
busybox
.h"
#include <stdio.h>
#include <time.h>
#include <utime.h>
#include <stdio.h>
#include <time.h>
#include <utime.h>
@@
-37,7
+37,7
@@
static const char *srcName;
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (unlink(fileName) < 0) {
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (unlink(fileName) < 0) {
- perror
(
fileName);
+ perror
_msg("%s",
fileName);
return (FALSE);
}
return (TRUE);
return (FALSE);
}
return (TRUE);
@@
-47,11
+47,11
@@
static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (recursiveFlag == FALSE) {
errno = EISDIR;
{
if (recursiveFlag == FALSE) {
errno = EISDIR;
- perror
(
fileName);
+ perror
_msg("%s",
fileName);
return (FALSE);
}
if (rmdir(fileName) < 0) {
return (FALSE);
}
if (rmdir(fileName) < 0) {
- perror
(
fileName);
+ perror
_msg("%s",
fileName);
return (FALSE);
}
return (TRUE);
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)
{
extern int rm_main(int argc, char **argv)
{
+ int status = EXIT_SUCCESS;
int stopIt=FALSE;
struct stat statbuf;
int stopIt=FALSE;
struct stat statbuf;
@@
-100,11
+101,11
@@
extern int rm_main(int argc, char **argv)
&& errno == ENOENT) {
/* do not reports errors for non-existent files if -f, just skip them */
} else {
&& errno == ENOENT) {
/* do not reports errors for non-existent files if -f, just skip them */
} else {
- if (recursive
A
ction(srcName, recursiveFlag, FALSE,
+ if (recursive
_a
ction(srcName, recursiveFlag, FALSE,
TRUE, fileAction, dirAction, NULL) == FALSE) {
TRUE, fileAction, dirAction, NULL) == FALSE) {
-
exit(FALSE)
;
+
status = EXIT_FAILURE
;
}
}
}
}
}
}
- return
(TRUE)
;
+ return
status
;
}
}