From: Andrew Tridgell Date: Sun, 17 May 1998 01:24:16 +0000 (+0000) Subject: close the other half of the pipe in do_recv(). This fixes the problem X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/6c29af225112d25581ec4aaa25666a11cf122c56 close the other half of the pipe in do_recv(). This fixes the problem where a rsync receive process could hang around after the connection has gone away if a fatal error occurs (such as someone killing the other end) --- diff --git a/main.c b/main.c index f557e552..188cf41d 100644 --- a/main.c +++ b/main.c @@ -242,11 +242,13 @@ 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]); recv_files(f_in,flist,local_name,recv_pipe[1]); if (am_daemon) report(-1); exit_cleanup(0); } + close(recv_pipe[1]); generate_files(f_out,flist,local_name,recv_pipe[0]); waitpid(pid, &status, 0);