Skip to contentSkip to conversation

ipcns: fix stupid !CONFIG_IPC error

PATCH New Serge E. Hallyn 1 participant 1 message Mar 27, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipcns: fix stupid !CONFIG_IPC error

Sorry, I broke CONFIG_IPC=n. This is a port of the patch Andrew used to fix it in -mm

Here is a question... When CONFIG_IPC_NS=n and the user asks for a new IPC namespace, we want to return -EINVAL to let them know we couldn't oblige. But if CONFIG_IPC=n is it ok to just return 0?

If not, then we'll need a somewhat different fix, as we can't #include sched.h in ipc.h.

thanks,
-serge

From: Serge E. Hallyn <[email protected]>
Subject: [PATCH] ipcns: fix stupid !CONFIG_IPC error

Andrew Morton pointed out my patch to fix CLONE_NEWIPC behavior when CONFIG_IPC_NS=n broke compilation when CONFIG_IPC=n.

Make sure copy_ipcs() is always defined.

---

 include/linux/ipc.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

d731d029f908b76af52d2abd9ab199fa931d2c98

include/linux/ipc.h +3 -1
index 5c05c88..6da6772 100644
@@ -92,11 +92,13 @@ extern struct ipc_namespace init_ipc_ns;
 
 #ifdef CONFIG_SYSVIPC
 #define INIT_IPC_NS(ns)		.ns		= &init_ipc_ns,
+extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
 #else
 #define INIT_IPC_NS(ns)
+static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk)
+{ return 0; }
 #endif
 
-extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
 #ifdef CONFIG_IPC_NS
 extern void free_ipc_ns(struct kref *kref);
 extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns);
Signature · 1 line
1.3.2