summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Hoffstätte <holger@applied-asynchrony.com>2020-06-19 17:22:54 +0200
committerGitHub <noreply@github.com>2020-06-19 08:22:54 -0700
commit0c13e1b3f856621b1a3cb70d5efcb500d51e1539 (patch)
tree7549ea68bc68587c0cc12c42fa2c947b02acf664
parent9da38f2f99b467a0103cc34d0c075450b8159f13 (diff)
downloadrsync-0c13e1b3f856621b1a3cb70d5efcb500d51e1539.tar.gz
Prevent unnecessary xattr warning by reordering header inclusion. (#22)
xattr headers have been provided by glibc (at least on Linux/glibc) for many years now. Reorder the inclusion of xattr headers to attempt compatibility/legacy after the common case. This prevents the warning without changing compatibility to non-glibc systems. * Add dependency on lib/sysxattrs.h header in Makefile Co-authored-by: Wayne Davison <wayne@opencoder.net>
-rw-r--r--Makefile.in1
-rw-r--r--lib/sysxattrs.h6
2 files changed, 4 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index 17dae3a6..31ddc43b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -100,6 +100,7 @@ rsync$(EXEEXT): $(OBJS)
$(OBJS): $(HEADERS)
$(CHECK_OBJS): $(HEADERS)
+tls.o xattrs.o: lib/sysxattrs.h
options.o: latest-year.h help-rsync.h help-rsyncd.h
exclude.o: default-cvsignore.h
loadparm.o: default-dont-compress.h
diff --git a/lib/sysxattrs.h b/lib/sysxattrs.h
index 428421a0..024bbd18 100644
--- a/lib/sysxattrs.h
+++ b/lib/sysxattrs.h
@@ -1,9 +1,9 @@
#ifdef SUPPORT_XATTRS
-#if defined HAVE_ATTR_XATTR_H
-#include <attr/xattr.h>
-#elif defined HAVE_SYS_XATTR_H
+#if defined HAVE_SYS_XATTR_H
#include <sys/xattr.h>
+#elif defined HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
#elif defined HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif