]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Don't loop forever when the receiver is waiting around to be killed
authorWayne Davison <wayned@samba.org>
Sun, 27 Feb 2005 18:24:34 +0000 (18:24 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 27 Feb 2005 18:24:34 +0000 (18:24 +0000)
at EOF -- it should be a rapidly arriving event, so only hang around
for 10 seconds, max., and then go ahead and report the "unexpectedly
closed" error.

io.c

diff --git a/io.c b/io.c
index c1f389783540e123d6ad1adb900b0039e8b860f4..b0bdabe8246ff818a12340565f0676a7a5e6738d 100644 (file)
--- a/io.c
+++ b/io.c
@@ -376,9 +376,11 @@ void io_set_filesfrom_fds(int f_in, int f_out)
 static void whine_about_eof(int fd)
 {
        if (kluge_around_eof && fd == sock_f_in) {
+               int i;
                if (kluge_around_eof > 0)
                        exit_cleanup(0);
-               while (1)
+               /* If we're still here after 10 seconds, exit with an error. */
+               for (i = 10*1000/20; i--; )
                        msleep(20);
        }