Change so the delay before generator signals receiver is only done on Cygwin.
authorDavid Dykstra <dwd@samba.org>
Tue, 28 Jan 2003 02:51:03 +0000 (02:51 +0000)
committerDavid Dykstra <dwd@samba.org>
Tue, 28 Jan 2003 02:51:03 +0000 (02:51 +0000)
NEWS
configure.in
main.c

diff --git a/NEWS b/NEWS
index 1cdb686..7ccf332 100644 (file)
--- 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:
 
index 843fe60..d0002c1 100644 (file)
@@ -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 53a237c..f61ead4 100644 (file)
--- 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;
 }