1 |
From 5ed20724012043e91683bcd5fcea197f59ae4120 Mon Sep 17 00:00:00 2001 |
2 |
From: Serge Hallyn <serge.hallyn@ubuntu.com> |
3 |
Date: Mon, 10 Mar 2014 23:17:07 -0500 |
4 |
Subject: [PATCH] misc/sys/xattr.h: guard against linux uapi header inclusion |
5 |
|
6 |
If the glibc xattr.h header is included after the uapi header, |
7 |
compilation fails due to an enum re-using a #define from the |
8 |
uapi header. Protect against this by guarding the define and |
9 |
enum inclusions against each other. |
10 |
|
11 |
(A corresponding kernel patch has been sent here: |
12 |
http://lkml.org/lkml/2014/3/7/331 ) |
13 |
|
14 |
(See https://lists.debian.org/debian-glibc/2014/03/msg00029.html |
15 |
and https://sourceware.org/glibc/wiki/Synchronizing_Headers |
16 |
for more information.) |
17 |
|
18 |
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> |
19 |
(cherry picked from commit fdbe8eae2b9aed74dabba1b0a189c5d7d61bf032) |
20 |
--- |
21 |
misc/sys/xattr.h | 2 ++ |
22 |
1 file changed, 2 insertions(+) |
23 |
|
24 |
diff --git a/misc/sys/xattr.h b/misc/sys/xattr.h |
25 |
index 929cd87..796df90 100644 |
26 |
--- a/misc/sys/xattr.h |
27 |
+++ b/misc/sys/xattr.h |
28 |
@@ -26,6 +26,7 @@ __BEGIN_DECLS |
29 |
|
30 |
/* The following constants should be used for the fifth parameter of |
31 |
`*setxattr'. */ |
32 |
+#ifndef __USE_KERNEL_XATTR_DEFS |
33 |
enum |
34 |
{ |
35 |
XATTR_CREATE = 1, /* set value, fail if attr already exists. */ |
36 |
@@ -33,6 +34,7 @@ enum |
37 |
XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */ |
38 |
#define XATTR_REPLACE XATTR_REPLACE |
39 |
}; |
40 |
+#endif |
41 |
|
42 |
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which |
43 |
is SIZE bytes long). Return 0 on success, -1 for errors. */ |
44 |
-- |
45 |
1.9.2 |
46 |
|