Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
ba2b6354
Unverified
Commit
ba2b6354
authored
Aug 26, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macro: coding style fixes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
0c5ea884
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
25 deletions
+21
-25
macro.h
src/lxc/macro.h
+21
-25
No files found.
src/lxc/macro.h
View file @
ba2b6354
...
@@ -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) \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment