diff options
author | Wayne Davison <wayned@samba.org> | 2010-08-26 08:50:05 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2010-08-26 11:12:58 -0700 |
commit | 2624e005e2c2407c8e108230e6615d2aaba42617 (patch) | |
tree | aefd03f05797d1b2dda9d2e27e1e64d92bdb79d6 /rsync.c | |
parent | c9bf436e5b80ad7d001773e3d750149c11f39411 (diff) | |
download | rsync-2624e005e2c2407c8e108230e6615d2aaba42617.tar.gz rsync-2624e005e2c2407c8e108230e6615d2aaba42617.tar.bz2 rsync-2624e005e2c2407c8e108230e6615d2aaba42617.zip |
Add --omit-link-times and use CAN_SET_SYMLINK_TIMES less.
Diffstat (limited to 'rsync.c')
-rw-r--r-- | rsync.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -489,11 +489,13 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, set_xattr(fname, file, fnamecmp, sxp); #endif - if (!preserve_times || (S_ISDIR(sxp->st.st_mode) && preserve_times == 1)) + if (!preserve_times + || (!(preserve_times & PRESERVE_DIR_TIMES) && S_ISDIR(sxp->st.st_mode)) + || (!(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) { - int ret = set_modtime(fname, file->modtime, F_MOD_NSEC(file), sxp->st.st_mode); + int ret = set_modtime(fname, file->modtime, F_MOD_NSEC(file), file->mode); if (ret < 0) { rsyserr(FERROR_XFER, errno, "failed to set times on %s", full_fname(fname)); |