diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -4213,7 +4213,7 @@ int res; uint32_t oldval; - if ((td->td_pflags & TDP_SIGFASTBLOCK) == 0) + if ((td->td_pflags & TDP_SIGFASTPENDING) == 0) return; res = fueword32((void *)td->td_sigblock_ptr, &oldval); if (res == -1) { diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -204,6 +204,7 @@ struct thread *td; struct proc *p; int flags, sig; + bool resched_sigs; td = curthread; p = td->td_proc; @@ -316,27 +317,24 @@ if (flags & TDF_NEEDSIGCHK || p->p_pendingcnt > 0 || !SIGISEMPTY(p->p_siglist)) { sigfastblock_fetch(td); - if ((td->td_pflags & TDP_SIGFASTBLOCK) != 0 && - td->td_sigblock_val != 0) { - sigfastblock_setpend(td, true); - } else { - PROC_LOCK(p); - mtx_lock(&p->p_sigacts->ps_mtx); - while ((sig = cursig(td)) != 0) { - KASSERT(sig >= 0, ("sig %d", sig)); - postsig(sig); - } - mtx_unlock(&p->p_sigacts->ps_mtx); - PROC_UNLOCK(p); + PROC_LOCK(p); + mtx_lock(&p->p_sigacts->ps_mtx); + while ((sig = cursig(td)) != 0) { + KASSERT(sig >= 0, ("sig %d", sig)); + postsig(sig); } + mtx_unlock(&p->p_sigacts->ps_mtx); + PROC_UNLOCK(p); + resched_sigs = true; + } else { + resched_sigs = false; } /* * Handle deferred update of the fast sigblock value, after * the postsig() loop was performed. */ - if (td->td_pflags & TDP_SIGFASTPENDING) - sigfastblock_setpend(td, false); + sigfastblock_setpend(td, resched_sigs); #ifdef KTRACE KTRUSERRET(td);