summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-30 00:56:43 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-30 00:56:43 +0000
commit49d6fdc03617747d92422b9759ff5c828070aa11 (patch)
tree58aa257433022ac722ff4e37fa15ad37b9378f0a
parent8b35435f7cc4708400c652434615ce48dc493de4 (diff)
downloadrsync-49d6fdc03617747d92422b9759ff5c828070aa11.tar.gz
patch from Jim Delahanty <mail_us@swbell.net> to ensure files are
deleted after being backed up in a rename operation
-rw-r--r--backup.c10
1 files 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)