added SIGPIPE catch
[rsync/rsync.git] / io.c
diff --git a/io.c b/io.c
index 5ca0e6c..22e5b3d 100644 (file)
--- a/io.c
+++ b/io.c
@@ -163,6 +163,7 @@ static int writefd(int fd,char *buf,int len)
 {
   int total = 0;
   fd_set fds;
+  struct timeval tv;
 
   if (buffer_f_in == -1) 
     return write(fd,buf,len);
@@ -180,7 +181,9 @@ static int writefd(int fd,char *buf,int len)
 
       FD_ZERO(&fds);
       FD_SET(fd,&fds);
-      select(16,NULL,&fds,NULL,NULL);
+      tv.tv_sec = BLOCKING_TIMEOUT;
+      tv.tv_usec = 0;
+      select(16,NULL,&fds,NULL,&tv);
     } else {
       total += ret;
     }