X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/6c29af225112d25581ec4aaa25666a11cf122c56..fdee2ba3df0efb75718d6f619d30a98a88d58134:/main.c diff --git a/main.c b/main.c index 188cf41d..5530e7c3 100644 --- a/main.c +++ b/main.c @@ -243,12 +243,14 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) if ((pid=do_fork()) == 0) { close(recv_pipe[0]); + close(f_out); recv_files(f_in,flist,local_name,recv_pipe[1]); if (am_daemon) report(-1); exit_cleanup(0); } close(recv_pipe[1]); + close(f_in); generate_files(f_out,flist,local_name,recv_pipe[0]); waitpid(pid, &status, 0); @@ -494,11 +496,6 @@ int main(int argc,char *argv[]) argv += optind; optind = 0; - if (argc < 1) { - usage(FERROR); - exit(1); - } - signal(SIGCHLD,SIG_IGN); signal(SIGINT,SIGNAL_CAST sig_int); signal(SIGPIPE,SIGNAL_CAST sig_int); @@ -508,6 +505,11 @@ int main(int argc,char *argv[]) return daemon_main(); } + if (argc < 1) { + usage(FERROR); + exit(1); + } + if (dry_run) verbose = MAX(verbose,1);