Blame SOURCES/rsync-3.2.3-append-mode.patch

f878b3
diff --git a/rsync.1.md b/rsync.1.md
f878b3
index ec971ecc..7bb4c5a1 100644
f878b3
--- a/rsync.1.md
f878b3
+++ b/rsync.1.md
f878b3
@@ -949,7 +949,9 @@ your home directory (remove the '=' for that).
f878b3
     existing content in the file (it only verifies the content that it is
f878b3
     appending).  Rsync skips any files that exist on the receiving side that
f878b3
     are not shorter than the associated file on the sending side (which means
f878b3
-    that new files are trasnferred).
f878b3
+    that new files are trasnferred).  It also skips any files whose size on the
f878b3
+    sending side gets shorter during the send negotiations (rsync warns about a
f878b3
+    "diminished" file when this happens).
f878b3
 
f878b3
     This does not interfere with the updating of a file's non-content
f878b3
     attributes (e.g.  permissions, ownership, etc.) when the file does not need
f878b3
diff --git a/sender.c b/sender.c
f878b3
index 94761c26..9cfca134 100644
f878b3
--- a/sender.c
f878b3
+++ b/sender.c
f878b3
@@ -362,6 +362,16 @@ void send_files(int f_in, int f_out)
f878b3
 			exit_cleanup(RERR_FILEIO);
f878b3
 		}
f878b3
 
f878b3
+		if (append_mode > 0 && st.st_size < F_LENGTH(file)) {
f878b3
+			rprintf(FWARNING, "skipped diminished file: %s\n",
f878b3
+				full_fname(fname));
f878b3
+			free_sums(s);
f878b3
+			close(fd);
f878b3
+			if (protocol_version >= 30)
f878b3
+				send_msg_int(MSG_NO_SEND, ndx);
f878b3
+			continue;
f878b3
+		}
f878b3
+
f878b3
 		if (IS_DEVICE(st.st_mode) && st.st_size == 0)
f878b3
 			st.st_size = get_device_size(fd, fname);
f878b3