Check for linux/falloc.h header file.
[rsync/rsync.git] / io.c
diff --git a/io.c b/io.c
index 3388269..63dff83 100644 (file)
--- a/io.c
+++ b/io.c
@@ -50,6 +50,7 @@ extern int file_total;
 extern int file_old_total;
 extern int list_only;
 extern int read_batch;
+extern int compat_flags;
 extern int protect_args;
 extern int checksum_seed;
 extern int protocol_version;
@@ -2204,13 +2205,16 @@ int32 read_ndx(int f)
 /* Read a line of up to bufsiz-1 characters into buf.  Strips
  * the (required) trailing newline and all carriage returns.
  * Returns 1 for success; 0 for I/O error or truncation. */
-int read_line_old(int fd, char *buf, size_t bufsiz)
+int read_line_old(int fd, char *buf, size_t bufsiz, int eof_ok)
 {
+       assert(fd != iobuf.in_fd);
        bufsiz--; /* leave room for the null */
        while (bufsiz > 0) {
-               assert(fd != iobuf.in_fd);
-               if (safe_read(fd, buf, 1) == 0)
+               if (safe_read(fd, buf, 1) == 0) {
+                       if (eof_ok)
+                               break;
                        return 0;
+               }
                if (*buf == '\0')
                        return 0;
                if (*buf == '\n')
@@ -2318,7 +2322,7 @@ void start_write_batch(int fd)
         * is involved. */
        write_int(batch_fd, protocol_version);
        if (protocol_version >= 30)
-               write_byte(batch_fd, inc_recurse);
+               write_byte(batch_fd, compat_flags);
        write_int(batch_fd, checksum_seed);
 
        if (am_sender)