summaryrefslogtreecommitdiff
path: root/generator.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2011-03-26 09:59:14 -0700
committerWayne Davison <wayned@samba.org>2011-03-26 10:09:20 -0700
commit78286a03d196efeed754aa4c1faa571f5dbea342 (patch)
tree6ba67b8ae2397f5a55278f5a7041d9b0a9d2d197 /generator.c
parentd699d815d6acdf18f73788c21f3be5e6611cfecf (diff)
downloadrsync-78286a03d196efeed754aa4c1faa571f5dbea342.tar.gz
rsync-78286a03d196efeed754aa4c1faa571f5dbea342.tar.bz2
rsync-78286a03d196efeed754aa4c1faa571f5dbea342.zip
Avoid re-setting (and sending) xattrs on a hard-linked file w/the same xattrs.
Improved the xattrs testing to include hard-linking.
Diffstat (limited to 'generator.c')
-rw-r--r--generator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generator.c b/generator.c
index d17e3b9e..e3890bb1 100644
--- a/generator.c
+++ b/generator.c
@@ -549,8 +549,10 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
#ifdef SUPPORT_XATTRS
if (preserve_xattrs && do_xfers
&& iflags & (ITEM_REPORT_XATTR|ITEM_TRANSFER)) {
- send_xattr_request(NULL, file,
- iflags & ITEM_REPORT_XATTR ? sock_f_out : -1);
+ int fd = iflags & ITEM_REPORT_XATTR
+ && (protocol_version < 31 || !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE))
+ ? sock_f_out : -1;
+ send_xattr_request(NULL, file, fd);
}
#endif
} else if (ndx >= 0) {