summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch
blob: e77d0c8c51c6be6060782ec5fdcdaf0fee9c98e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 2261f47bac78aa77934ca03980ed54d1d86116b9 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Thu, 23 Jun 2016 16:26:43 +0800
Subject: [PATCH] Ensure the XATTR_NAME_CAPS is defined when it is used
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Pending

VFS_CAP_U32 can not ensure that XATTR_NAME_CAPS is defined, and failed to build
libcap-native in old release, like CentOS release 6.7 (Final), with the blow
error:
     cap_file.c: In function ‘cap_get_fd’:
     cap_file.c:199: error: ‘XATTR_NAME_CAPS’ undeclared (first use in this function)
     cap_file.c:199: error: (Each undeclared identifier is reported only once

Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 libcap/cap_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcap/cap_file.c b/libcap/cap_file.c
index 0bc07f7..37bc34e 100644
--- a/libcap/cap_file.c
+++ b/libcap/cap_file.c
@@ -44,7 +44,7 @@ extern int fremovexattr(int, const char *);
 
 #include "libcap.h"
 
-#ifdef VFS_CAP_U32
+#if defined (VFS_CAP_U32) && defined (XATTR_NAME_CAPS)
 
 #if VFS_CAP_U32 != __CAP_BLKS
 # error VFS representation of capabilities is not the same size as kernel