Insert a 100ms sleep just before sending the USR2 signal to the
authorDavid Dykstra <dwd@samba.org>
Mon, 27 Jan 2003 03:52:42 +0000 (03:52 +0000)
committerDavid Dykstra <dwd@samba.org>
Mon, 27 Jan 2003 03:52:42 +0000 (03:52 +0000)
child receiver process to prevent some hangs on Cygwin.  Anthony
Heading discovered the workaround first and suggested 30ms, and
Greger Cronquist had better luck with 100ms.

NEWS
main.c

diff --git a/NEWS b/NEWS
index 47433c6..1cdb686 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -75,6 +75,8 @@ rsync changes since last release
 
     * Prevent "Connection reset by peer" messages from Cygwin. (Randy O'Meara)
 
+    * Prevent some hangs at the end of a run on Cygwin. (Anthony Heading)
+
   INTERNAL:
 
     * Many code cleanups and improved internal documentation.  (Martin 
diff --git a/main.c b/main.c
index b571b3a..53a237c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -462,6 +462,8 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
        io_flush();
 
        io_set_error_fd(-1);
+       /* workaround for cygwin hangs; wait to make sure child is ready */
+       msleep(100); 
        kill(pid, SIGUSR2);
        wait_process(pid, &status);
        return status;