History

xattr: fix check for simultaneous glibc header inclusion

The guard was introduced in commit ea1a8217b06b ("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)

Filipe Brandenburger committed 12 years ago

Commit bfcfd441 parent b41d34b1 file · +1 −1Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/xattr.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13#ifndef _UAPI_LINUX_XATTR_H13#ifndef _UAPI_LINUX_XATTR_H
14#define _UAPI_LINUX_XATTR_H14#define _UAPI_LINUX_XATTR_H
15 15
16#ifdef __UAPI_DEF_XATTR16#if __UAPI_DEF_XATTR
17#define __USE_KERNEL_XATTR_DEFS17#define __USE_KERNEL_XATTR_DEFS
18 18
19#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */19#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */