csomh / rpms / rsync

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