X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/41cfde6be388364f9bf7dfa9a532625b1f660df7..a0a33ee50659b6d67bfdeb593af9f8df216ce97b:/main.c diff --git a/main.c b/main.c index 20c93c25..9c84b071 100644 --- a/main.c +++ b/main.c @@ -481,12 +481,17 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) if (fd_pair(error_pipe) < 0 || (need_name_pipe && fd_pair(name_pipe) < 0)) { rsyserr(FERROR, errno, "pipe failed in do_recv"); - exit_cleanup(RERR_SOCKETIO); + exit_cleanup(RERR_IPC); } io_flush(NORMAL_FLUSH); - if ((pid = do_fork()) == 0) { + if ((pid = do_fork()) == -1) { + rsyserr(FERROR, errno, "fork failed in do_recv"); + exit_cleanup(RERR_IPC); + } + + if (pid == 0) { close(error_pipe[0]); if (need_name_pipe) { close(name_pipe[1]); @@ -683,6 +688,8 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) if (am_sender) { keep_dirlinks = 0; /* Must be disabled on the sender. */ io_start_buffering_out(); + if (!remote_filesfrom_file) + set_msg_fd_in(f_in); if (cvs_exclude) add_cvs_excludes(); if (delete_mode && !delete_excluded) @@ -694,6 +701,7 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) start_write_batch(f_out); if (!read_batch) /* don't write to pipe */ flist = send_file_list(f_out,argc,argv); + set_msg_fd_in(-1); if (verbose > 3) rprintf(FINFO,"file list sent\n");