From 49d6fdc03617747d92422b9759ff5c828070aa11 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Jan 2000 00:56:43 +0000 Subject: [PATCH] patch from Jim Delahanty to ensure files are deleted after being backed up in a rename operation --- backup.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backup.c b/backup.c index ee323f3f..52590c13 100644 --- 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) -- 2.34.1