Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern From Roger Pau Monne: kill(2) called for a zombie p...
details: https://anonhg.NetBSD.org/src/rev/bbd03eb3e1a4
branches: trunk
changeset: 780272:bbd03eb3e1a4
user: christos <christos%NetBSD.org@localhost>
date: Wed Jul 18 20:30:07 2012 +0000
description:
>From Roger Pau Monne: kill(2) called for a zombie process should return 0,
according to:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html
diffstat:
sys/kern/sys_sig.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diffs (33 lines):
diff -r e345d384c2ca -r bbd03eb3e1a4 sys/kern/sys_sig.c
--- a/sys/kern/sys_sig.c Wed Jul 18 20:09:19 2012 +0000
+++ b/sys/kern/sys_sig.c Wed Jul 18 20:30:07 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_sig.c,v 1.37 2012/02/19 21:06:57 rmind Exp $ */
+/* $NetBSD: sys_sig.c,v 1.38 2012/07/18 20:30:07 christos Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.37 2012/02/19 21:06:57 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.38 2012/07/18 20:30:07 christos Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -240,10 +240,11 @@
if (pid > 0) {
/* kill single process */
mutex_enter(proc_lock);
- p = proc_find(pid);
- if (p == NULL) {
+ p = proc_find_raw(pid);
+ if (p == NULL || (p->p_stat != SACTIVE && p->p_stat != SSTOP)) {
mutex_exit(proc_lock);
- return ESRCH;
+ /* IEEE Std 1003.1-2001: return success for zombies */
+ return p ? 0 : ESRCH;
}
mutex_enter(p->p_lock);
error = kauth_authorize_process(l->l_cred,
Home |
Main Index |
Thread Index |
Old Index