]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
tar/write.h: Support `sys/xattr.h` (#2335) 2344/head
authorMichał Górny <mgorny@gentoo.org>
Sat, 21 Sep 2024 02:44:06 +0000 (04:44 +0200)
committerGitHub <noreply@github.com>
Sat, 21 Sep 2024 02:44:06 +0000 (19:44 -0700)
Synchronize the last use of `attr/xattr.h` to support using
`sys/xattr.h` instead. The former header is deprecated on GNU/Linux, and
this replacement makes it possible to build libarchive without the
`attr` package.

tar/write.c

index 1d1139f4cde5c6ee588d749c2d90ce2068fb7aa8..43cd7023339795064a805474e3b653560fc9e8ea 100644 (file)
@@ -32,7 +32,9 @@
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
-#ifdef HAVE_ATTR_XATTR_H
+#if HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#elif HAVE_ATTR_XATTR_H
 #include <attr/xattr.h>
 #endif
 #ifdef HAVE_ERRNO_H