summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>2003-01-27 03:52:42 +0000
committerDavid Dykstra <dwd@samba.org>2003-01-27 03:52:42 +0000
commit787568f3719e0f80881fdf2124e11dc97c827ec4 (patch)
tree09194b3640af9c249191606d3c93831ff53f4720
parentf0019fc506808d19233aa712216c8de72bd0a2f6 (diff)
downloadrsync-787568f3719e0f80881fdf2124e11dc97c827ec4.tar.gz
Insert a 100ms sleep just before sending the USR2 signal to the
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.
-rw-r--r--NEWS2
-rw-r--r--main.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 47433c67..1cdb6867 100644
--- 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 b571b3a8..53a237ca 100644
--- 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;