diff options
author | Wayne Davison <wayned@samba.org> | 2009-01-03 12:00:02 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2009-01-03 12:02:47 -0800 |
commit | 21cddef2b460098f5289b9cdbd592bf8f0f9e759 (patch) | |
tree | e19d41350ae9753ac69ac0cb86fa3cc3042be8fd /rsync.c | |
parent | b3bf9b9df95137a3a43248be9599d919b04877af (diff) | |
download | rsync-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); } |