diff options
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; |