Commit b55115ec authored by Wayne Davison's avatar Wayne Davison

Fix --only-write-batch hang with --hard-links.

Fixes bug 8565.
parent f5e2b8f8
......@@ -81,6 +81,7 @@ extern int link_dest;
extern int whole_file;
extern int list_only;
extern int read_batch;
extern int write_batch;
extern int safe_symlinks;
extern long block_size; /* "long" because popt can't set an int32. */
extern int unsort_ndx;
......@@ -1813,7 +1814,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
notify_others:
if (remove_source_files && !delay_updates && !phase && !dry_run)
increment_active_files(ndx, itemizing, code);
if (inc_recurse && !dry_run)
if (inc_recurse && (!dry_run || write_batch < 0))
cur_flist->in_progress++;
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && F_IS_HLINKED(file))
......
......@@ -496,7 +496,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
int prev_statret, ndx, prev_ndx = F_HL_PREV(file);
if (stp == NULL && prev_ndx >= 0) {
if (link_stat(fname, &st, 0) < 0) {
if (link_stat(fname, &st, 0) < 0 && !dry_run) {
rsyserr(FERROR_XFER, errno, "stat %s failed",
full_fname(fname));
return;
......
......@@ -681,6 +681,8 @@ int recv_files(int f_in, int f_out, char *local_name)
log_item(FCLIENT, file, iflags, NULL);
if (!am_server)
discard_receive_data(f_in, F_LENGTH(file));
if (inc_recurse)
send_msg_int(MSG_SUCCESS, ndx);
continue;
}
......
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