summaryrefslogtreecommitdiff
path: root/rsync.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2018-01-15 10:52:15 -0800
committerWayne Davison <wayned@samba.org>2018-01-15 10:58:31 -0800
commit0f8e9e2d8638e47d646a6baba694b303ac84e695 (patch)
tree8b8d7ec208fa77b0f6becaae5c376f86d064d330 /rsync.c
parentc4a3f55be35726d0a033996dc37b0fb248b45cb5 (diff)
downloadrsync-0f8e9e2d8638e47d646a6baba694b303ac84e695.tar.gz
Don't force nanoseconds if a file wasn't transferred or checksummed.
Diffstat (limited to 'rsync.c')
-rw-r--r--rsync.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rsync.c b/rsync.c
index ae036a6b..a0b948dc 100644
--- a/rsync.c
+++ b/rsync.c
@@ -556,7 +556,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
if (!(flags & ATTRS_SKIP_MTIME)
&& (sxp->st.st_mtime != file->modtime
#ifdef ST_MTIME_NSEC
- || (NSEC_BUMP(file) && (uint32)sxp->st.ST_MTIME_NSEC != F_MOD_NSEC(file))
+ || (flags & ATTRS_SET_NANO && 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);
@@ -672,7 +672,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
/* Change permissions before putting the file into place. */
set_file_attrs(fnametmp, file, NULL, fnamecmp,
- ok_to_set_time ? 0 : ATTRS_SKIP_MTIME);
+ ok_to_set_time ? ATTRS_SET_NANO : ATTRS_SKIP_MTIME);
/* move tmp file over real file */
if (DEBUG_GTE(RECV, 1))
@@ -697,7 +697,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
do_set_file_attrs:
set_file_attrs(fnametmp, file, NULL, fnamecmp,
- ok_to_set_time ? 0 : ATTRS_SKIP_MTIME);
+ ok_to_set_time ? ATTRS_SET_NANO : ATTRS_SKIP_MTIME);
if (temp_copy_name) {
if (do_rename(fnametmp, fname) < 0) {