Prevent unnecessary xattr warning by reordering header inclusion. (#22)
authorHolger Hoffstätte <holger@applied-asynchrony.com>
Fri, 19 Jun 2020 15:22:54 +0000 (17:22 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Jun 2020 15:22:54 +0000 (08:22 -0700)
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>
Makefile.in
lib/sysxattrs.h

index 17dae3a68c439a0c486cd747de4d3cd27da7eaa1..31ddc43b22210158e65372e59a7062f8165814bb 100644 (file)
@@ -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
index 428421a046ab91c9832a69a9fd45388bb065d2c0..024bbd184655f92a08dbd52b6381ac9ba387fdf5 100644 (file)
@@ -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