summaryrefslogtreecommitdiff
path: root/coreutils/mv.c
diff options
context:
space:
mode:
authorMatt Kraai2001-04-24 20:04:18 +0000
committerMatt Kraai2001-04-24 20:04:18 +0000
commit8810bdbba359eb2348cc371f12347dd7f41dda18 (patch)
treed1403572448114ecd20030316914f473816f882d /coreutils/mv.c
parent9f0fedb8f693829e7869439a2ad43cc1c21a3786 (diff)
downloadbusybox-8810bdbba359eb2348cc371f12347dd7f41dda18.zip
busybox-8810bdbba359eb2348cc371f12347dd7f41dda18.tar.gz
Rewrote rm.
Diffstat (limited to 'coreutils/mv.c')
-rw-r--r--coreutils/mv.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/coreutils/mv.c b/coreutils/mv.c
index efc4ae6..b890abf 100644
--- a/coreutils/mv.c
+++ b/coreutils/mv.c
@@ -32,20 +32,6 @@
static int flags;
-static int remove_file(const char *path, struct stat *statbuf, void *junk)
-{
- if (unlink(path) < 0)
- return FALSE;
- return TRUE;
-}
-
-static int remove_directory(const char *path, struct stat *statbuf, void *junk)
-{
- if (rmdir(path) < 0)
- return FALSE;
- return TRUE;
-}
-
static int manual_rename(const char *source, const char *dest)
{
struct stat source_stat;
@@ -92,8 +78,7 @@ static int manual_rename(const char *source, const char *dest)
FILEUTILS_PRESERVE_SYMLINKS) < 0)
return -1;
- if (!recursive_action(source, TRUE, FALSE, TRUE, remove_file,
- remove_directory, NULL))
+ if (remove_file(source, FILEUTILS_RECUR | FILEUTILS_FORCE) < 0)
return -1;
return 0;