Another update from Larry:
[oweals/busybox.git] / mv.c
diff --git a/mv.c b/mv.c
index efc4ae6d87d0990ead0ea8bc7ff2c74643f70631..b890abf6efcc89c402b3ea4df40469742e8437ec 100644 (file)
--- a/mv.c
+++ b/mv.c
 
 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;