patch from Jim Delahanty <mail_us@swbell.net> to ensure files are
authorAndrew Tridgell <tridge@samba.org>
Sun, 30 Jan 2000 00:56:43 +0000 (00:56 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 30 Jan 2000 00:56:43 +0000 (00:56 +0000)
deleted after being backed up in a rename operation

backup.c

index ee323f3..52590c1 100644 (file)
--- a/backup.c
+++ b/backup.c
@@ -134,10 +134,14 @@ static int robust_move(char *src, char *dst)
        int failed;
 
        while (keep_trying) {
-               if (keep_path_extfs)
-                       failed = copy_file (src, dst, 0755);
-               else
+               if (keep_path_extfs) {
+                       failed = copy_file(src, dst, 0755);
+                       if (!failed) {
+                               do_unlink(src);
+                       }
+               } else {
                        failed = robust_rename (src, dst);
+               }
 
                if (failed) {
                        if (verbose > 2)