diff options
author | pjd <pjd@FreeBSD.org> | 2004-07-29 20:38:19 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-07-29 20:38:19 +0000 |
commit | 809d561dd58e47559bb01a65babc759b68996b24 (patch) | |
tree | 7a5750e32d938d5832f5aa78dbb523dd8cf56a25 | |
parent | 7e5db42c7abc6797cb566c6f9dfc3f529e5dbb5c (diff) | |
download | FreeBSD-src-809d561dd58e47559bb01a65babc759b68996b24.zip FreeBSD-src-809d561dd58e47559bb01a65babc759b68996b24.tar.gz |
Syscall kill(2) called for a zombie process should return 0.
Obtained from: Darwin
-rw-r--r-- | sys/kern/kern_sig.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index f82b838..0941607 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1383,8 +1383,17 @@ kill(td, uap) if (uap->pid > 0) { /* kill single process */ - if ((p = pfind(uap->pid)) == NULL) + if ((p = pfind(uap->pid)) == NULL) { + if ((p = zpfind(uap->pid)) != NULL) { + /* + * IEEE Std 1003.1-2001: return success + * when killing a zombie. + */ + PROC_UNLOCK(p); + return (0); + } return (ESRCH); + } error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum) psignal(p, uap->signum); |