Use <sys/xattr.h> rather than the deprecated <attr/xattr.h> from libattr
Guillem Jover <guillem@debian.org> writes:
> The former header has been removed in upstream libattr, but got
> reintroduced in Debian to avoid breakage just before the Debian buster
> freeze. But I'd like to be able to remove it in Debian too, so that
> the interface can be synced with upstream.
Closes: #953906
Andrej Shadura
4 years ago
0 | From: Andrej Shadura <andrewsh@debian.org> | |
1 | Date: Sat, 14 Mar 2020 20:08:43 +0100 | |
2 | Subject: Use <sys/xattr.h> rather than the deprecated <attr/xattr.h> from | |
3 | libattr | |
4 | ||
5 | In the Debian bug #953906 Guillem Jover <guillem@debian.org> writes: | |
6 | ||
7 | > The former header has been removed in upstream libattr, but got | |
8 | > reintroduced in Debian to avoid breakage just before the Debian buster | |
9 | > freeze. But I'd like to be able to remove it in Debian too, so that | |
10 | > the interface can be synced with upstream. | |
11 | ||
12 | Bug-Debian: https://bugs.debian.org/953906 | |
13 | --- | |
14 | ports/linux/subports | 4 ++-- | |
15 | ports/linux/xattr/portdefs.h | 2 +- | |
16 | ports/linux/xattr/pseudo_wrappers.c | 4 ++-- | |
17 | 3 files changed, 5 insertions(+), 5 deletions(-) | |
18 | ||
19 | diff --git a/ports/linux/subports b/ports/linux/subports | |
20 | index a29044a..44e0e9e 100755 | |
21 | --- a/ports/linux/subports | |
22 | +++ b/ports/linux/subports | |
23 | @@ -29,11 +29,11 @@ fi | |
24 | if $port_xattr; then | |
25 | cat > dummy.c <<EOF | |
26 | #include <sys/types.h> | |
27 | -#include <attr/xattr.h> | |
28 | +#include <sys/xattr.h> | |
29 | int i; | |
30 | EOF | |
31 | if ! ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then | |
32 | - echo >&2 "Warning: Can't compile trivial program using <attr/xattr.h>". | |
33 | + echo >&2 "Warning: Can't compile trivial program using <sys/xattr.h>". | |
34 | echo >&2 " xattr support will require that header." | |
35 | fi | |
36 | echo "linux/xattr" | |
37 | diff --git a/ports/linux/xattr/portdefs.h b/ports/linux/xattr/portdefs.h | |
38 | index 56cd3ca..cd2e2f5 100644 | |
39 | --- a/ports/linux/xattr/portdefs.h | |
40 | +++ b/ports/linux/xattr/portdefs.h | |
41 | @@ -2,5 +2,5 @@ | |
42 | * SPDX-License-Identifier: LGPL-2.1-only | |
43 | * | |
44 | */ | |
45 | -#include <attr/xattr.h> | |
46 | +#include <sys/xattr.h> | |
47 | #include <stdint.h> | |
48 | diff --git a/ports/linux/xattr/pseudo_wrappers.c b/ports/linux/xattr/pseudo_wrappers.c | |
49 | index 590af30..c4f9d1f 100644 | |
50 | --- a/ports/linux/xattr/pseudo_wrappers.c | |
51 | +++ b/ports/linux/xattr/pseudo_wrappers.c | |
52 | @@ -135,7 +135,7 @@ static ssize_t shared_getxattr(const char *path, int fd, const char *name, void | |
53 | path ? path : "<no path>", fd, name); | |
54 | pseudo_msg_t *result = pseudo_client_op(OP_GET_XATTR, 0, fd, -1, path, &buf, name); | |
55 | if (result->result != RESULT_SUCCEED) { | |
56 | - errno = ENOATTR; | |
57 | + errno = ENODATA; | |
58 | return -1; | |
59 | } | |
60 | ||
61 | @@ -256,7 +256,7 @@ static ssize_t shared_listxattr(const char *path, int fd, char *list, size_t siz | |
62 | pseudo_msg_t *result = pseudo_client_op(OP_LIST_XATTR, 0, fd, -1, path, &buf); | |
63 | if (result->result != RESULT_SUCCEED) { | |
64 | pseudo_debug(PDBGF_XATTR, "listxattr: no success.\n"); | |
65 | - errno = ENOATTR; | |
66 | + errno = ENODATA; | |
67 | return -1; | |
68 | } | |
69 | if (list) { |