Avoid --remove-sent-file issue for non-regular files.
authorWayne Davison <wayned@samba.org>
Sun, 12 Jul 2015 20:25:37 +0000 (13:25 -0700)
committerWayne Davison <wayned@samba.org>
Sun, 12 Jul 2015 20:26:01 +0000 (13:26 -0700)
sender.c

index 5adc2fd89cbd55eee03bfbfc324de89bdfab9e02..d20ff4e1e9b43f631d42a5792a77897d2f3e7377 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -143,11 +143,12 @@ void successful_send(int ndx)
                goto failed;
        }
 
-       if (st.st_size != F_LENGTH(file) || st.st_mtime != file->modtime
+       if (S_ISREG(file->mode) /* Symlinks & devices don't need this check: */
+        && (st.st_size != F_LENGTH(file) || st.st_mtime != file->modtime
 #ifdef ST_MTIME_NSEC
         || (NSEC_BUMP(file) && (uint32)st.ST_MTIME_NSEC != F_MOD_NSEC(file))
 #endif
-       ) {
+       )) {
                rprintf(FERROR_XFER, "ERROR: Skipping sender remove for changed file: %s\n", fname);
                return;
        }