aboutsummaryrefslogtreecommitdiffstats
path: root/rsync.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2010-08-26 08:50:05 -0700
committerWayne Davison <wayned@samba.org>2010-08-26 11:12:58 -0700
commit2624e005e2c2407c8e108230e6615d2aaba42617 (patch)
treeaefd03f05797d1b2dda9d2e27e1e64d92bdb79d6 /rsync.c
parentc9bf436e5b80ad7d001773e3d750149c11f39411 (diff)
downloadandroid_external_rsync-2624e005e2c2407c8e108230e6615d2aaba42617.tar.gz
android_external_rsync-2624e005e2c2407c8e108230e6615d2aaba42617.tar.bz2
android_external_rsync-2624e005e2c2407c8e108230e6615d2aaba42617.zip
Add --omit-link-times and use CAN_SET_SYMLINK_TIMES less.
Diffstat (limited to 'rsync.c')
-rw-r--r--rsync.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rsync.c b/rsync.c
index c9be4247..91fb9e30 100644
--- a/rsync.c
+++ b/rsync.c
@@ -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));