pyxattr/0002-use-system-xattr-h.patch

40 lines
1.4 KiB
Diff
Raw Normal View History

diff --git a/xattr.c.org b/xattr.c
index c792df3..a419b95 100644
--- a/xattr.c.org
+++ b/xattr.c
@@ -23,7 +23,9 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include <attr/xattr.h>
+#if defined(__APPLE__) || defined(__linux__)
+#include <sys/xattr.h>
+#endif
#include <stdio.h>
/* Compatibility with python 2.4 regarding python size type (PEP 353) */
@@ -551,11 +553,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds)
buf_val = buf_val_tmp;
nalloc = realloc_size;
continue;
- } else if(
-#ifdef ENODATA
- errno == ENODATA ||
-#endif
- errno == ENOATTR) {
+ } else if (errno == ENODATA) {
/* this attribute has gone away since we queried
the attribute list */
missing = 1;
@@ -1137,8 +1135,7 @@ static char __xattr_doc__[] = \
" a :exc:`EnvironmentError`; under\n"
" Linux, the following ``errno`` values are used:\n"
"\n"
- " - ``ENOATTR`` and ``ENODATA`` mean that the attribute name is\n"
- " invalid\n"
+ " - ``ENODATA`` means that the attribute name is\n invalid\n"
" - ``ENOTSUP`` and ``EOPNOTSUPP`` mean that the filesystem does not\n"
" support extended attributes, or that the namespace is invalid\n"
" - ``E2BIG`` mean that the attribute value is too big\n"