Skip to content

Commit a671154

Browse files
filbrandengregkh
authored andcommitted
xattr: fix check for simultaneous glibc header inclusion
commit bfcfd44 upstream. The guard was introduced in commit ea1a821 ("xattr: guard against simultaneous glibc header inclusion") but it is using #ifdef to check for a define that is either set to 1 or 0. Fix it to use #if instead. * Without this patch: $ { echo "#include <sys/xattr.h>"; echo "#include <linux/xattr.h>"; } | gcc -E -Iinclude/uapi - >/dev/null include/uapi/linux/xattr.h:19:0: warning: "XATTR_CREATE" redefined [enabled by default] #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ ^ /usr/include/x86_64-linux-gnu/sys/xattr.h:32:0: note: this is the location of the previous definition #define XATTR_CREATE XATTR_CREATE ^ * With this patch: $ { echo "#include <sys/xattr.h>"; echo "#include <linux/xattr.h>"; } | gcc -E -Iinclude/uapi - >/dev/null (no warnings) Signed-off-by: Filipe Brandenburger <filbranden@google.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> Cc: Allan McRae <allan@archlinux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c84e107 commit a671154

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/uapi/linux/xattr.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef _UAPI_LINUX_XATTR_H
1414
#define _UAPI_LINUX_XATTR_H
1515

16-
#ifdef __UAPI_DEF_XATTR
16+
#if __UAPI_DEF_XATTR
1717
#define __USE_KERNEL_XATTR_DEFS
1818

1919
#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */

0 commit comments

Comments
 (0)