]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
added SIGPIPE catch
authorAndrew Tridgell <tridge@samba.org>
Wed, 26 Jun 1996 03:21:27 +0000 (03:21 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 26 Jun 1996 03:21:27 +0000 (03:21 +0000)
added select timeout

.cvsignore
io.c
main.c
rsync.h
version.h

index d24a597051d6825d75134c6ca1c44647f415a484..1390d9047311c4adfd7478a329cea0a526b9474a 100644 (file)
@@ -42,6 +42,8 @@ rsync-0.9.tar.gz
 rsync-1.0
 rsync-1.1
 rsync-1.1.tar.gz
+rsync-1.2
+rsync-1.2.tar.gz
 rsync-ERSION
 rsync.aux
 rsync.dvi
diff --git a/io.c b/io.c
index 5ca0e6c6808b185b00ddd79603671e82fca913f2..22e5b3db26396003a41ae930b4508faf077a96d8 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;
     }
diff --git a/main.c b/main.c
index a2733e64b1e0f846556b7e483c7ef19a2fd11964..721fdbb703cb5ec9cceaad6b11c951dfeed6d407 100644 (file)
--- a/main.c
+++ b/main.c
@@ -653,6 +653,7 @@ int main(int argc,char *argv[])
     
     signal(SIGCHLD,SIG_IGN);
     signal(SIGINT,SIGNAL_CAST sig_int);
+    signal(SIGPIPE,SIGNAL_CAST sig_int);
 
     if (!sender && argc != 1) {
       usage(stderr);
diff --git a/rsync.h b/rsync.h
index fd24df5e38ca1e15d1c7057439bb2e26a50e0edc..7592c89e8c61dc4df449199ed7b94b6aac088778 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -29,6 +29,8 @@
 /* block size to write files in */
 #define WRITE_BLOCK_SIZE (32*1024)
 
+#define BLOCKING_TIMEOUT 10
+
 #include "config.h"
 
 #include <sys/types.h>
index 1fc901baf3a4d8ac7ce0f3410b68e7737ecaa104..eb5ec468ce42317e08a284df9dfdde6b037b6947 100644 (file)
--- a/version.h
+++ b/version.h
@@ -1 +1 @@
-#define VERSION "1.1"
+#define VERSION "1.3"