close the other half of the pipe in do_recv(). This fixes the problem
authorAndrew Tridgell <tridge@samba.org>
Sun, 17 May 1998 01:24:16 +0000 (01:24 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 17 May 1998 01:24:16 +0000 (01:24 +0000)
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)

main.c

diff --git a/main.c b/main.c
index f557e55..188cf41 100644 (file)
--- 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);