if f_in == f_out then don't close one of them
authorAndrew Tridgell <tridge@samba.org>
Sun, 17 May 1998 15:18:25 +0000 (15:18 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 17 May 1998 15:18:25 +0000 (15:18 +0000)
main.c

diff --git a/main.c b/main.c
index 5530e7c..dbe6aab 100644 (file)
--- a/main.c
+++ b/main.c
@@ -243,14 +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);
+               if (f_in != f_out) 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);
+       if (f_in != f_out) close(f_in);
        generate_files(f_out,flist,local_name,recv_pipe[0]);
 
        waitpid(pid, &status, 0);