aboutsummaryrefslogtreecommitdiff
path: root/mv.c
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-24 20:04:18 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-24 20:04:18 +0000
commit8695b23e5809a0b952accd98da299f86b126d5fd (patch)
treed1403572448114ecd20030316914f473816f882d /mv.c
parentc1db72874a1dbb92ee3dca555e1561e6a95b5ce2 (diff)
downloadbusybox-w32-8695b23e5809a0b952accd98da299f86b126d5fd.tar.gz
busybox-w32-8695b23e5809a0b952accd98da299f86b126d5fd.tar.bz2
busybox-w32-8695b23e5809a0b952accd98da299f86b126d5fd.zip
Rewrote rm.
git-svn-id: svn://busybox.net/trunk/busybox@2423 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'mv.c')
-rw-r--r--mv.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/mv.c b/mv.c
index efc4ae6d8..b890abf6e 100644
--- a/mv.c
+++ b/mv.c
@@ -32,20 +32,6 @@
32 32
33static int flags; 33static int flags;
34 34
35static int remove_file(const char *path, struct stat *statbuf, void *junk)
36{
37 if (unlink(path) < 0)
38 return FALSE;
39 return TRUE;
40}
41
42static int remove_directory(const char *path, struct stat *statbuf, void *junk)
43{
44 if (rmdir(path) < 0)
45 return FALSE;
46 return TRUE;
47}
48
49static int manual_rename(const char *source, const char *dest) 35static int manual_rename(const char *source, const char *dest)
50{ 36{
51 struct stat source_stat; 37 struct stat source_stat;
@@ -92,8 +78,7 @@ static int manual_rename(const char *source, const char *dest)
92 FILEUTILS_PRESERVE_SYMLINKS) < 0) 78 FILEUTILS_PRESERVE_SYMLINKS) < 0)
93 return -1; 79 return -1;
94 80
95 if (!recursive_action(source, TRUE, FALSE, TRUE, remove_file, 81 if (remove_file(source, FILEUTILS_RECUR | FILEUTILS_FORCE) < 0)
96 remove_directory, NULL))
97 return -1; 82 return -1;
98 83
99 return 0; 84 return 0;