From 8ed16deb249535905b947496290e19344e93ea41 Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Tue, 28 Jan 2003 02:51:03 +0000 Subject: [PATCH] Change so the delay before generator signals receiver is only done on Cygwin. --- NEWS | 2 +- configure.in | 12 +++++++++++- main.c | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1cdb6867..7ccf3328 100644 --- a/NEWS +++ b/NEWS @@ -75,7 +75,7 @@ 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) + * Prevent some hangs at the end of a run on Cygwin. (Anthony Heading) INTERNAL: diff --git a/configure.in b/configure.in index 843fe60b..d0002c19 100644 --- a/configure.in +++ b/configure.in @@ -259,7 +259,17 @@ AC_DEFINE_UNQUOTED(DEFAULT_MODIFY_WINDOW, $DEFAULT_MODIFY_WINDOW, AC_MSG_CHECKING([whether to call shutdown on all sockets]) case $host_os in *cygwin* ) AC_MSG_RESULT(yes) - AC_DEFINE(SHUTDOWN_ALL_SOCKETS, 1, [Define if sockets need to be shutdown]) + AC_DEFINE(SHUTDOWN_ALL_SOCKETS, 1, + [Define if sockets need to be shutdown]) + ;; + * ) AC_MSG_RESULT(no);; +esac + +AC_MSG_CHECKING([whether generator should delay before signaling receiver]) +case $host_os in + *cygwin* ) AC_MSG_RESULT(yes) + AC_DEFINE(DELAY_BEFORE_SIGNALING_RECEIVER, 1, + [Define if generator should delay before signaling receiver]) ;; * ) AC_MSG_RESULT(no);; esac diff --git a/main.c b/main.c index 53a237ca..f61ead43 100644 --- a/main.c +++ b/main.c @@ -462,9 +462,11 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) io_flush(); io_set_error_fd(-1); +#ifdef DELAY_BEFORE_SIGNALING_RECEIVER /* workaround for cygwin hangs; wait to make sure child is ready */ msleep(100); kill(pid, SIGUSR2); +#endif wait_process(pid, &status); return status; } -- 2.34.1