Commit 9d954dca authored by Wayne Davison's avatar Wayne Davison

Make sure that the presence of a partial-dir file is noted, even

if --whole-file is in effect.  Also needed to force statret to 0
when using a partial-dir file.
parent 7162c65d
...@@ -485,7 +485,7 @@ static void recv_generator(char *fname, struct file_struct *file, int i, ...@@ -485,7 +485,7 @@ static void recv_generator(char *fname, struct file_struct *file, int i,
stat_errno = ENOENT; stat_errno = ENOENT;
} }
if (partial_dir && (partialptr = partial_dir_fname(fname)) if (partial_dir && (partialptr = partial_dir_fname(fname)) != NULL
&& link_stat(partialptr, &partial_st, 0) == 0 && link_stat(partialptr, &partial_st, 0) == 0
&& S_ISREG(partial_st.st_mode)) { && S_ISREG(partial_st.st_mode)) {
if (statret == -1) if (statret == -1)
...@@ -528,6 +528,13 @@ static void recv_generator(char *fname, struct file_struct *file, int i, ...@@ -528,6 +528,13 @@ static void recv_generator(char *fname, struct file_struct *file, int i,
} }
prepare_to_open: prepare_to_open:
if (partialptr) {
st = partial_st;
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
statret = 0;
}
if (dry_run || whole_file > 0) { if (dry_run || whole_file > 0) {
statret = -1; statret = -1;
goto notify_others; goto notify_others;
...@@ -535,12 +542,6 @@ prepare_to_open: ...@@ -535,12 +542,6 @@ prepare_to_open:
if (read_batch) if (read_batch)
goto notify_others; goto notify_others;
if (partialptr) {
st = partial_st;
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
}
/* open the file */ /* open the file */
fd = do_open(fnamecmp, O_RDONLY, 0); fd = do_open(fnamecmp, O_RDONLY, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment