From d4689024703d32da7b227a1aca2c09ebbc74648d Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 4 Oct 2021 08:48:12 +0000 Subject: [PATCH] Simplify sys___thrsigdivert a bit. cursig() always moves the pending signal to p_siglist and so there is no need to check ps_siglist for the signal. OK mpi@ --- sys/kern/kern_sig.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 24d87cdb50f..4a76f751b36 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.283 2021/09/28 10:00:18 claudio Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.284 2021/10/04 08:48:12 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1752,8 +1752,6 @@ sys___thrsigdivert(struct proc *p, void *v, register_t *retval) syscallarg(siginfo_t *) info; syscallarg(const struct timespec *) timeout; } */ *uap = v; - struct process *pr = p->p_p; - sigset_t *m; sigset_t mask = SCARG(uap, sigmask) &~ sigcantmask; siginfo_t si; uint64_t nsecs = INFSLP; @@ -1782,15 +1780,7 @@ sys___thrsigdivert(struct proc *p, void *v, register_t *retval) if (si.si_signo != 0) { sigset_t smask = sigmask(si.si_signo); if (smask & mask) { - if (p->p_siglist & smask) - m = &p->p_siglist; - else if (pr->ps_siglist & smask) - m = &pr->ps_siglist; - else { - /* signal got eaten by someone else? */ - continue; - } - atomic_clearbits_int(m, smask); + atomic_clearbits_int(&p->p_siglist, smask); error = 0; break; } -- 2.20.1