Call set_modtime even if only NSEC is different.
authorWayne Davison <wayned@samba.org>
Wed, 31 Dec 2014 19:02:03 +0000 (11:02 -0800)
committerWayne Davison <wayned@samba.org>
Wed, 31 Dec 2014 21:10:37 +0000 (13:10 -0800)
rsync.c

diff --git a/rsync.c b/rsync.c
index c498c44fdc013a56c3a385691fcb8294f3fccab9..68ff6b100931e1cf33977bc149060bbef64f16a5 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -548,7 +548,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
         || (!(preserve_times & PRESERVE_LINK_TIMES) && S_ISLNK(sxp->st.st_mode)))
                flags |= ATTRS_SKIP_MTIME;
        if (!(flags & ATTRS_SKIP_MTIME)
-           && cmp_time(sxp->st.st_mtime, file->modtime) != 0) {
+        && (sxp->st.st_mtime != file->modtime
+#ifdef ST_MTIME_NSEC
+         || (NSEC_BUMP(file) && (uint32)sxp->st.ST_MTIME_NSEC != F_MOD_NSEC(file))
+#endif
+         )) {
                int ret = set_modtime(fname, file->modtime, F_MOD_NSEC(file), sxp->st.st_mode);
                if (ret < 0) {
                        rsyserr(FERROR_XFER, errno, "failed to set times on %s",