diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-10-15 05:09:02 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-10-15 05:09:02 +0000 |
commit | 5d0e2280c62829f61d7b035a8eb33603d7b6647f (patch) | |
tree | 1914890f8f9cfefa702eaedee529c0f3bee70db1 | |
parent | 5d1fbaecac17fd94e9a807fc5a4ad9ed4393f28f (diff) |
Process groups can't be removed if a zombie process is in them, so
ispidtaken() can rely on pgfind() for all pgrp checks and can simply
use zombiefind() for the zombie check
ok jca@
-rw-r--r-- | sys/kern/kern_fork.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index de299003ff7..4c0b932b92e 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.189 2016/09/03 14:29:05 jca Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.190 2016/10/15 05:09:01 guenther Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -554,7 +554,6 @@ int ispidtaken(pid_t pid) { uint32_t i; - struct process *pr; for (i = 0; i < nitems(oldpids); i++) if (pid == oldpids[i]) @@ -564,11 +563,8 @@ ispidtaken(pid_t pid) return (1); if (pgfind(pid) != NULL) return (1); - LIST_FOREACH(pr, &zombprocess, ps_list) { - if (pr->ps_pid == pid || - (pr->ps_pgrp && pr->ps_pgrp->pg_id == pid)) - return (1); - } + if (zombiefind(pid) != NULL) + return (1); return (0); } |