Switching to GPL 3.
[rsync/rsync.git] / io.c
diff --git a/io.c b/io.c
index 1c85880..7edc562 100644 (file)
--- a/io.c
+++ b/io.c
@@ -7,7 +7,7 @@
  * Copyright (C) 2003-2007 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
+ * it under the terms of the GNU General Public License version 3 as
  * published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ * with this program; if not, visit the http://fsf.org website.
  */
 
 /* Rsync provides its own multiplexing system, which is used to send
@@ -340,6 +339,10 @@ static void read_msg_fd(void)
                /* Read extra file list from receiver. */
                assert(iobuf_in != NULL);
                assert(iobuf_f_in == fd);
+               if (verbose > 3) {
+                       rprintf(FINFO, "[%s] receiving flist for dir %d\n",
+                               who_am_i(), IVAL(buf,0));
+               }
                flist = recv_file_list(fd);
                flist->parent_ndx = IVAL(buf,0);
                break;
@@ -673,7 +676,7 @@ static int read_timeout(int fd, char *buf, size_t len)
                                                        io_filesfrom_bp = io_filesfrom_buf;
                                                else
                                                        io_filesfrom_bp += l;
-                                       } else {
+                                       } else if (errno != EINTR) {
                                                /* XXX should we complain? */
                                                io_filesfrom_f_out = -1;
                                        }
@@ -684,11 +687,13 @@ static int read_timeout(int fd, char *buf, size_t len)
                                                     io_filesfrom_buf,
                                                     sizeof io_filesfrom_buf);
                                        if (l <= 0) {
-                                               /* Send end-of-file marker */
-                                               io_filesfrom_buf[0] = '\0';
-                                               io_filesfrom_buf[1] = '\0';
-                                               io_filesfrom_buflen = io_filesfrom_lastchar? 2 : 1;
-                                               io_filesfrom_f_in = -1;
+                                               if (l == 0 || errno != EINTR) {
+                                                       /* Send end-of-file marker */
+                                                       io_filesfrom_buf[0] = '\0';
+                                                       io_filesfrom_buf[1] = '\0';
+                                                       io_filesfrom_buflen = io_filesfrom_lastchar? 2 : 1;
+                                                       io_filesfrom_f_in = -1;
+                                               }
                                        } else {
                                                if (!eol_nulls) {
                                                        char *s = io_filesfrom_buf + l;