lkml.org 
[lkml]   [2006]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[RFC][PATCH 06/20] cad_pid: Fixup the cad_pid users to assume it is in the initial process id namespace.
From
Date

Having the kernel memorize pids of running processes is ugly. Especially if
those processes are allowed to exit. So we don't introduce any lifetime issues
or any other weird uglyness and simply insist that the cad_pid is always
interpreted with respect to the initial process id namespace.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>


---

drivers/parisc/power.c | 3 ++-
kernel/sys.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)

f343da178ee420b5b35a7fa43cc7995f47024004
diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c
index 54b2b7f..fbf14d9 100644
--- a/drivers/parisc/power.c
+++ b/drivers/parisc/power.c
@@ -45,6 +45,7 @@
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
+#include <linux/pspace.h>

#include <asm/pdc.h>
#include <asm/io.h>
@@ -86,7 +87,7 @@
static void deferred_poweroff(void *dummy)
{
extern int cad_pid; /* from kernel/sys.c */
- if (kill_proc(cad_pid, SIGINT, 1)) {
+ if (kill_proc(&init_pspace, cad_pid, SIGINT, 1)) {
/* just in case killing init process failed */
machine_power_off();
}
diff --git a/kernel/sys.c b/kernel/sys.c
index bd594c3..d9fcc0e 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -581,7 +581,7 @@ void ctrl_alt_del(void)
if (C_A_D)
schedule_work(&cad_work);
else
- kill_proc(cad_pid, SIGINT, 1);
+ kill_proc(&init_pspace, cad_pid, SIGINT, 1);
}


--
1.1.5.g3480
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-06 20:44    [W:0.277 / U:0.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site