[lxc-devel] [lxd/master] lxd/include: Relocate ifndef for NEWCGROUP

stgraber on Github lxc-bot at linuxcontainers.org
Thu Oct 8 19:25:04 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201008/e2fb5b91/attachment.bin>
-------------- next part --------------
From 985e7cafd3e9afbe94b4781c736a84f957099c9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 8 Oct 2020 15:23:37 -0400
Subject: [PATCH] lxd/include: Relocate ifndef for NEWCGROUP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/include/macro.h     | 4 ++++
 lxd/main_forksyscall.go | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lxd/include/macro.h b/lxd/include/macro.h
index 6986a1f685..fc6dd72b55 100644
--- a/lxd/include/macro.h
+++ b/lxd/include/macro.h
@@ -278,4 +278,8 @@ enum {
 #define CLONE_NEWTIME 0x00000080
 #endif
 
+#ifndef CLONE_NEWCGROUP
+#define CLONE_NEWCGROUP	0x02000000
+#endif
+
 #endif /* __LXC_MACRO_H */
diff --git a/lxd/main_forksyscall.go b/lxd/main_forksyscall.go
index b4a62a3b92..4b770e73e7 100644
--- a/lxd/main_forksyscall.go
+++ b/lxd/main_forksyscall.go
@@ -199,10 +199,6 @@ static void mknod_emulate(void)
 	}
 }
 
-#ifndef CLONE_NEWCGROUP
-#define CLONE_NEWCGROUP	0x02000000
-#endif
-
 const static int ns_flags[] = { CLONE_NEWUSER, CLONE_NEWPID, CLONE_NEWUTS, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWCGROUP };
 
 static bool change_creds(int pidfd, int ns_fd, cap_t caps, uid_t nsuid, gid_t nsgid, uid_t nsfsuid, gid_t nsfsgid)


More information about the lxc-devel mailing list