if f_in == f_out then don't close one of them

This commit is contained in:
Andrew Tridgell
1998-05-17 15:18:25 +00:00
parent 7544c45b1d
commit 593fde2d3b

4
main.c
View File

@@ -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);