Commit bfcfd44c authored by Filipe Brandenburger's avatar Filipe Brandenburger Committed by Linus Torvalds

xattr: fix check for simultaneous glibc header inclusion

The guard was introduced in commit ea1a8217 ("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: default avatarFilipe Brandenburger <filbranden@google.com>
Acked-by: default avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
Cc: Allan McRae <allan@archlinux.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b41d34b4
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#ifndef _UAPI_LINUX_XATTR_H #ifndef _UAPI_LINUX_XATTR_H
#define _UAPI_LINUX_XATTR_H #define _UAPI_LINUX_XATTR_H
#ifdef __UAPI_DEF_XATTR #if __UAPI_DEF_XATTR
#define __USE_KERNEL_XATTR_DEFS #define __USE_KERNEL_XATTR_DEFS
#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment