diff options
author | Wayne Davison <wayned@samba.org> | 2018-01-15 10:52:15 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2018-01-15 10:58:31 -0800 |
commit | 0f8e9e2d8638e47d646a6baba694b303ac84e695 (patch) | |
tree | 8b8d7ec208fa77b0f6becaae5c376f86d064d330 /rsync.c | |
parent | c4a3f55be35726d0a033996dc37b0fb248b45cb5 (diff) | |
download | rsync-0f8e9e2d8638e47d646a6baba694b303ac84e695.tar.gz |
Don't force nanoseconds if a file wasn't transferred or checksummed.
Diffstat (limited to 'rsync.c')
-rw-r--r-- | rsync.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |