diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-01-30 00:56:43 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-01-30 00:56:43 +0000 |
commit | 49d6fdc03617747d92422b9759ff5c828070aa11 (patch) | |
tree | 58aa257433022ac722ff4e37fa15ad37b9378f0a | |
parent | 8b35435f7cc4708400c652434615ce48dc493de4 (diff) | |
download | rsync-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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) |