summaryrefslogtreecommitdiff
path: root/rsync.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-01-03 12:00:02 -0800
committerWayne Davison <wayned@samba.org>2009-01-03 12:02:47 -0800
commit21cddef2b460098f5289b9cdbd592bf8f0f9e759 (patch)
treee19d41350ae9753ac69ac0cb86fa3cc3042be8fd /rsync.c
parentb3bf9b9df95137a3a43248be9599d919b04877af (diff)
downloadrsync-21cddef2b460098f5289b9cdbd592bf8f0f9e759.tar.gz
Improved the backup code:
- Backups do not interfere with an atomic update (when possible). - Backing up a file will remove a directory that is in the way and visa versa. - Unify the backup-dir and non-backup-dir code in backup.c. - Improved the backup tests a little bit.
Diffstat (limited to 'rsync.c')
-rw-r--r--rsync.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rsync.c b/rsync.c
index c420cf83..2c026a2d 100644
--- a/rsync.c
+++ b/rsync.c
@@ -561,9 +561,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
}
if (make_backups > 0 && overwriting_basis) {
- if (!make_backup(fname))
+ int ok = make_backup(fname, False);
+ if (!ok)
return 1;
- if (fnamecmp == fname)
+ if (ok == 1 && fnamecmp == fname)
fnamecmp = get_backup_name(fname);
}