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 80d0858fae013f9280b29aa2bf41b89174afe753..b48ae0f98ebdf7dc7e6faa9a7b5e78707e46de58 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 d0b25417416a53521b10754ef37c2f4586fc8992..5530e7c3fe06c2f90c613d43f373cb900ea9a95d 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);