Blame SOURCES/rsync-3.1.2-remove-symlinks.patch

c4f026
diff --git a/sender.c b/sender.c
c4f026
index 03e4aadd..9b432ed9 100644
c4f026
--- a/sender.c
c4f026
+++ b/sender.c
c4f026
@@ -32,6 +32,7 @@ extern int logfile_format_has_i;
c4f026
 extern int want_xattr_optim;
c4f026
 extern int csum_length;
c4f026
 extern int append_mode;
c4f026
+extern int copy_links;
c4f026
 extern int io_error;
c4f026
 extern int flist_eof;
c4f026
 extern int allowed_lull;
c4f026
@@ -138,17 +139,16 @@ void successful_send(int ndx)
c4f026
 		return;
c4f026
 	f_name(file, fname);
c4f026
 
c4f026
-	if (do_lstat(fname, &st) < 0) {
c4f026
+	if ((copy_links ? do_stat(fname, &st) : do_lstat(fname, &st)) < 0) {
c4f026
 		failed_op = "re-lstat";
c4f026
 		goto failed;
c4f026
 	}
c4f026
 
c4f026
-	if (S_ISREG(file->mode) /* Symlinks & devices don't need this check: */
c4f026
-	 && (st.st_size != F_LENGTH(file) || st.st_mtime != file->modtime
c4f026
+	if (st.st_size != F_LENGTH(file) || st.st_mtime != file->modtime
c4f026
 #ifdef ST_MTIME_NSEC
c4f026
 	 || (NSEC_BUMP(file) && (uint32)st.ST_MTIME_NSEC != F_MOD_NSEC(file))
c4f026
 #endif
c4f026
-	)) {
c4f026
+	) {
c4f026
 		rprintf(FERROR_XFER, "ERROR: Skipping sender remove for changed file: %s\n", fname);
c4f026
 		return;
c4f026
 	}