close some unnecessary file descriptors in do_recv()
authorAndrew Tridgell <tridge@samba.org>
Sun, 17 May 1998 07:22:53 +0000 (07:22 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 17 May 1998 07:22:53 +0000 (07:22 +0000)
io.c
main.c

diff --git a/io.c b/io.c
index 80d0858..b48ae0f 100644 (file)
--- a/io.c
+++ b/io.c
@@ -45,8 +45,8 @@ static int buffer_f_in = -1;
 
 void setup_nonblocking(int f_in,int f_out)
 {
-  set_blocking(f_out,0);
-  buffer_f_in = f_in;
+       set_blocking(f_out,0);
+       buffer_f_in = f_in;
 }
 
 
diff --git a/main.c b/main.c
index d0b2541..5530e7c 100644 (file)
--- 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);