macro: coding style fixes

parent 0c5ea884
...@@ -39,7 +39,11 @@ ...@@ -39,7 +39,11 @@
#define __S_ISTYPE(mode, mask) (((mode)&S_IFMT) == (mask)) #define __S_ISTYPE(mode, mask) (((mode)&S_IFMT) == (mask))
#endif #endif
#if HAVE_LIBCAP /* capabilities */
#ifndef CAP_SYS_ADMIN
#define CAP_SYS_ADMIN 21
#endif
#ifndef CAP_SETFCAP #ifndef CAP_SETFCAP
#define CAP_SETFCAP 31 #define CAP_SETFCAP 31
#endif #endif
...@@ -51,11 +55,6 @@ ...@@ -51,11 +55,6 @@
#ifndef CAP_MAC_ADMIN #ifndef CAP_MAC_ADMIN
#define CAP_MAC_ADMIN 33 #define CAP_MAC_ADMIN 33
#endif #endif
#endif
#ifndef PR_CAPBSET_DROP
#define PR_CAPBSET_DROP 24
#endif
#ifndef CAP_SETUID #ifndef CAP_SETUID
#define CAP_SETUID 7 #define CAP_SETUID 7
...@@ -65,25 +64,20 @@ ...@@ -65,25 +64,20 @@
#define CAP_SETGID 6 #define CAP_SETGID 6
#endif #endif
/* needed for cgroup automount checks, regardless of whether we /* prctl */
* have included linux/capability.h or not */ #ifndef PR_CAPBSET_DROP
#ifndef CAP_SYS_ADMIN
#define CAP_SYS_ADMIN 21
#endif
#ifndef HAVE_DECL_PR_CAPBSET_DROP
#define PR_CAPBSET_DROP 24 #define PR_CAPBSET_DROP 24
#endif #endif
/* prctl */ #ifndef PR_SET_NO_NEW_PRIVS
#ifndef HAVE_DECL_PR_SET_NO_NEW_PRIVS
#define PR_SET_NO_NEW_PRIVS 38 #define PR_SET_NO_NEW_PRIVS 38
#endif #endif
#ifndef HAVE_DECL_PR_GET_NO_NEW_PRIVS #ifndef PR_GET_NO_NEW_PRIVS
#define PR_GET_NO_NEW_PRIVS 39 #define PR_GET_NO_NEW_PRIVS 39
#endif #endif
/* filesystem magic values */
#ifndef CGROUP_SUPER_MAGIC #ifndef CGROUP_SUPER_MAGIC
#define CGROUP_SUPER_MAGIC 0x27e0eb #define CGROUP_SUPER_MAGIC 0x27e0eb
#endif #endif
...@@ -96,15 +90,16 @@ ...@@ -96,15 +90,16 @@
#define NSFS_MAGIC 0x6e736673 #define NSFS_MAGIC 0x6e736673
#endif #endif
/* We have two different magic values for overlayfs, yay. */ /* current overlayfs */
#ifndef OVERLAYFS_SUPER_MAGIC
#define OVERLAYFS_SUPER_MAGIC 0x794c764f
#endif
#ifndef OVERLAY_SUPER_MAGIC #ifndef OVERLAY_SUPER_MAGIC
#define OVERLAY_SUPER_MAGIC 0x794c7630 #define OVERLAY_SUPER_MAGIC 0x794c7630
#endif #endif
/* legacy overlayfs */
#ifndef OVERLAYFS_SUPER_MAGIC
#define OVERLAYFS_SUPER_MAGIC 0x794c764f
#endif
/* Calculate the number of chars needed to represent a given integer as a C /* Calculate the number of chars needed to represent a given integer as a C
* string. Include room for '-' to indicate negative numbers and the \0 byte. * string. Include room for '-' to indicate negative numbers and the \0 byte.
* This is based on systemd. * This is based on systemd.
...@@ -179,14 +174,15 @@ ...@@ -179,14 +174,15 @@
* though, hence the two different methods. * though, hence the two different methods.
*/ */
#ifndef __OPTIMIZE__ #ifndef __OPTIMIZE__
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2 * !!(condition)]))
#else #else
extern int __build_bug_on_failed; extern int __build_bug_on_failed;
#define BUILD_BUG_ON(condition) \ #define BUILD_BUG_ON(condition) \
do { \ do { \
((void)sizeof(char[1 - 2*!!(condition)])); \ ((void)sizeof(char[1 - 2 * !!(condition)])); \
if (condition) __build_bug_on_failed = 1; \ if (condition) \
} while(0) __build_bug_on_failed = 1; \
} while (0)
#endif #endif
#define lxc_iterate_parts(__iterator, __splitme, __separators) \ #define lxc_iterate_parts(__iterator, __splitme, __separators) \
......
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