From 787568f3719e0f80881fdf2124e11dc97c827ec4 Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Mon, 27 Jan 2003 03:52:42 +0000 Subject: [PATCH] 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. --- NEWS | 2 ++ main.c | 2 ++ 2 files changed, 4 insertions(+) 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; -- 2.34.1