diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-04-24 20:04:18 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-04-24 20:04:18 +0000 |
commit | 8695b23e5809a0b952accd98da299f86b126d5fd (patch) | |
tree | d1403572448114ecd20030316914f473816f882d /mv.c | |
parent | c1db72874a1dbb92ee3dca555e1561e6a95b5ce2 (diff) | |
download | busybox-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.c | 17 |
1 files changed, 1 insertions, 16 deletions
@@ -32,20 +32,6 @@ | |||
32 | 32 | ||
33 | static int flags; | 33 | static int flags; |
34 | 34 | ||
35 | static 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 | |||
42 | static 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 | |||
49 | static int manual_rename(const char *source, const char *dest) | 35 | static 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; |