From: claudio Date: Thu, 18 Apr 2024 08:59:38 +0000 (+0000) Subject: Clear PCATCH for procs that have P_WEXIT set. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c0de6c7f07d7e4dcfdde2e7663c1c02686158c60;p=openbsd Clear PCATCH for procs that have P_WEXIT set. Exiting procs will not return to userland and can not deliver signals so it is better to not even try. OK mpi@ --- diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index f6d04bc1cc4..e613b67742e 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.201 2024/03/30 13:33:20 mpi Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.202 2024/04/18 08:59:38 claudio Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -342,6 +342,9 @@ sleep_setup(const volatile void *ident, int prio, const char *wmesg) if (p->p_stat != SONPROC) panic("tsleep: not SONPROC"); #endif + /* exiting processes are not allowed to catch signals */ + if (p->p_flag & P_WEXIT) + CLR(prio, PCATCH); SCHED_LOCK(s);