summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-02-14 10:55:26 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-02-14 10:55:26 +0200
commit48a546b02c9e2c4e72a8aa83a2e36d1b8f24536b (patch)
treee267e575ce946962b2801f3a6fd33ac9600f67e0 /lib
parent46da9968df4bad8ce3899f98000aa5612375d29f (diff)
downloadtar-48a546b02c9e2c4e72a8aa83a2e36d1b8f24536b.tar.gz
Use correct headers/libraries when providing xattr support
See https://savannah.gnu.org/patch/index.php?8252. Patch provided by Anthony G. Basile. * acinclude.m4 (TAR_HEADERS_ATTR_XATTR_H): Look for <sys/xattr.h> first and then for <attr/xattr.h>. Link against libattr.so if needed. * lib/xattr-at.h: Include sys/xattr.h or attr/xattr.h, depending on which one is detected. * src/Makefile.am [TAR_LIB_ATTR] (tar_LDADD): Link against -lattr.
Diffstat (limited to 'lib')
-rw-r--r--lib/xattr-at.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/xattr-at.h b/lib/xattr-at.h
index 1ee534dd..3c6eb726 100644
--- a/lib/xattr-at.h
+++ b/lib/xattr-at.h
@@ -20,7 +20,15 @@
#define XATTRS_AT_H
#include <sys/types.h>
-#include <attr/xattr.h>
+#if defined(HAVE_SYS_XATTR_H)
+# include <sys/xattr.h>
+#elif defined(HAVE_ATTR_XATTR_H)
+# include <attr/xattr.h>
+#endif
+
+#ifndef ENOATTR
+# define ENOATTR ENODATA /* No such attribute */
+#endif
/* These are the dir-fd-relative variants of the functions without the
"at" suffix. For example, setxattrat (AT_FDCWD, path, name, value, size,