X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/adc19c987b2238fa64428621c7956b0b1b25b5e3..ae682c3e115aae1e15811e1411f5e7e3438d3193:/main.c diff --git a/main.c b/main.c index 32d47e6d..7d04adf6 100644 --- a/main.c +++ b/main.c @@ -25,6 +25,19 @@ struct stats stats; extern int verbose; + +/**************************************************************************** +wait for a process to exit, calling io_flush while waiting +****************************************************************************/ +void wait_process(pid_t pid, int *status) +{ + while (waitpid(pid, status, WNOHANG) == 0) { + msleep(20); + io_flush(); + } + *status = WEXITSTATUS(*status); +} + static void report(int f) { time_t t = time(NULL); @@ -343,7 +356,6 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) close(recv_pipe[1]); close(error_pipe[1]); - io_close_input(f_in); if (f_in != f_out) close(f_in); io_start_buffering(f_out);