Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932321AbWBFTlg (ORCPT ); Mon, 6 Feb 2006 14:41:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932322AbWBFTlg (ORCPT ); Mon, 6 Feb 2006 14:41:36 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:36333 "EHLO ebiederm.dsl.xmission.com") by vger.kernel.org with ESMTP id S932321AbWBFTle (ORCPT ); Mon, 6 Feb 2006 14:41:34 -0500 To: Cc: , Herbert Poetzl , "Serge E. Hallyn" , Alan Cox , Dave Hansen , Arjan van de Ven , Suleiman Souhlal , Hubertus Franke , Cedric Le Goater , Kyle Moffett , Kirill Korotaev , Greg , Linus Torvalds , Andrew Morton , Greg KH , Rik van Riel , Alexey Kuznetsov , Andrey Savochkin , Kirill Korotaev , Andi Kleen , Benjamin Herrenschmidt , Jeff Garzik , Trond Myklebust , Jes Sorensen Subject: [RFC][PATCH 06/20] cad_pid: Fixup the cad_pid users to assume it is in the initial process id namespace. References: From: ebiederm@xmission.com (Eric W. Biederman) Date: Mon, 06 Feb 2006 12:39:02 -0700 In-Reply-To: (Eric W. Biederman's message of "Mon, 06 Feb 2006 12:36:42 -0700") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1678 Lines: 58 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 --- 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 #include #include +#include #include #include @@ -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/