diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-04-18 08:59:39 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-04-18 08:59:39 +0000 |
commit | d613d05bd4473195e6c4e909a1803ede02af42dd (patch) | |
tree | 2d5af18e1543bd3684939a3c4083efb6a423a6ca | |
parent | 1b0750f00e786dce4f48af6a841b3735f2572d24 (diff) |
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@
-rw-r--r-- | sys/kern/kern_synch.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |