summaryrefslogtreecommitdiff
path: root/receiver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-05-09 17:38:47 +0000
committerWayne Davison <wayned@samba.org>2006-05-09 17:38:47 +0000
commit01d124d9e251317cdd9f12fb170a94e65f3c5e18 (patch)
treebdf9c7a0091dcf2b90211c51c61f0cf52b4b2162 /receiver.c
parent58a06312a4891ed375614d60ba92ce2a54d68a5e (diff)
downloadrsync-01d124d9e251317cdd9f12fb170a94e65f3c5e18.tar.gz
rsync-01d124d9e251317cdd9f12fb170a94e65f3c5e18.tar.bz2
rsync-01d124d9e251317cdd9f12fb170a94e65f3c5e18.zip
If the --partial-dir value is an absolute path and we use a file in
it as an alternate basis file, make sure that we delete it when the associated destination file is successfully updated.
Diffstat (limited to 'receiver.c')
-rw-r--r--receiver.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/receiver.c b/receiver.c
index 26be6f55..b6215fb3 100644
--- a/receiver.c
+++ b/receiver.c
@@ -617,9 +617,14 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
}
if ((recv_ok && (!delay_updates || !partialptr)) || inplace) {
- if (partialptr == fname || *partial_dir == '/')
- partialptr = NULL;
- finish_transfer(fname, fnametmp, partialptr,
+ char *temp_copy_name;
+ if (partialptr == fname)
+ partialptr = temp_copy_name = NULL;
+ else if (*partial_dir == '/')
+ temp_copy_name = NULL;
+ else
+ temp_copy_name = partialptr;
+ finish_transfer(fname, fnametmp, temp_copy_name,
file, recv_ok, 1);
if (fnamecmp == partialptr) {
do_unlink(partialptr);