summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>1999-03-23 22:20:10 +0000
committerDavid Dykstra <dwd@samba.org>1999-03-23 22:20:10 +0000
commit1f8413449dc6430e59b7383c25454de72503f007 (patch)
tree9a2246784ac3a425ef032a013644ef3f6bd5d7d8
parentd0a7c8a4870331d5bf2d52b2e4e6cc5e2c56b9f7 (diff)
downloadrsync-1f8413449dc6430e59b7383c25454de72503f007.tar.gz
Fix bug with --compare-dest option where missing parent directories in the
target destination were not getting created. There was a case in receiver.c to do that but it was only getting invoked when the -R option is specified, although I don't know why it was limited to that. It's too bad I didn't get a chance to more fully test the use of --compare-dest by my nsbd program before releasing rsync 2.3.0. I'll probably need to put a workaround in nsbd too until the next release of rsync.
-rw-r--r--receiver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/receiver.c b/receiver.c
index 0533fffe..816d69fd 100644
--- a/receiver.c
+++ b/receiver.c
@@ -417,7 +417,8 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
fd2 = do_open(fnametmp,O_WRONLY|O_CREAT|O_EXCL,
file->mode & INITACCESSPERMS);
- if (fd2 == -1 && relative_paths && errno == ENOENT &&
+ if (fd2 == -1 && errno == ENOENT &&
+ (relative_paths || (compare_dest != NULL)) &&
create_directory_path(fnametmp) == 0) {
fd2 = do_open(fnametmp,O_WRONLY|O_CREAT|O_EXCL,
file->mode & INITACCESSPERMS);