Avoid --remove-sent-file issue for non-regular files.

This commit is contained in:
Wayne Davison
2015-07-12 13:25:37 -07:00
parent 0bcb8b639a
commit dfbcc4f7ec

View File

@@ -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;
}