aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-02-27 18:24:34 +0000
committerWayne Davison <wayned@samba.org>2005-02-27 18:24:34 +0000
commit55bb7fff14fca1a5e0c27a781ea8d6e94e091ed8 (patch)
tree88d35f17f9ccd0af3d3fbee5f6708bf2107a44b6 /io.c
parent662bdcd4ac65f2e6220615f7fd10e90d248e0596 (diff)
downloadandroid_external_rsync-55bb7fff14fca1a5e0c27a781ea8d6e94e091ed8.tar.gz
android_external_rsync-55bb7fff14fca1a5e0c27a781ea8d6e94e091ed8.tar.bz2
android_external_rsync-55bb7fff14fca1a5e0c27a781ea8d6e94e091ed8.zip
Don't loop forever when the receiver is waiting around to be killed
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.
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io.c b/io.c
index c1f38978..b0bdabe8 100644
--- 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);
}