Style. Improve some KASSERTs messages.

Reviewed by:	jilles
Tested by:	pho
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27871
This commit is contained in:
Konstantin Belousov 2020-12-31 02:45:47 +02:00
parent 811f08c1cf
commit 993a1699b1
3 changed files with 10 additions and 12 deletions

View File

@ -629,12 +629,10 @@ enterthispgrp(struct proc *p, struct pgrp *pgrp)
PGRP_LOCK_ASSERT(p->p_pgrp, MA_NOTOWNED);
SESS_LOCK_ASSERT(p->p_session, MA_NOTOWNED);
KASSERT(pgrp->pg_session == p->p_session,
("%s: pgrp's session %p, p->p_session %p.\n",
__func__,
pgrp->pg_session,
p->p_session));
("%s: pgrp's session %p, p->p_session %p proc %p\n",
__func__, pgrp->pg_session, p->p_session, p));
KASSERT(pgrp != p->p_pgrp,
("%s: p belongs to pgrp.", __func__));
("%s: p %p belongs to pgrp %p", __func__, p, pgrp));
doenterpgrp(p, pgrp);

View File

@ -2227,9 +2227,9 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
* is default; don't stop the process below if sleeping,
* and don't clear any pending SIGCONT.
*/
if ((prop & SIGPROP_TTYSTOP) &&
(p->p_pgrp->pg_jobc == 0) &&
(action == SIG_DFL)) {
if ((prop & SIGPROP_TTYSTOP) != 0 &&
p->p_pgrp->pg_jobc == 0 &&
action == SIG_DFL) {
if (ksi && (ksi->ksi_flags & KSI_INS))
ksiginfo_tryfree(ksi);
return (ret);
@ -2984,10 +2984,10 @@ issignal(struct thread *td)
* should ignore tty stops.
*/
if (prop & SIGPROP_STOP) {
if (p->p_flag &
(P_TRACED | P_WEXIT | P_SINGLE_EXIT) ||
if ((p->p_flag & (P_TRACED | P_WEXIT |
P_SINGLE_EXIT)) != 0 ||
(p->p_pgrp->pg_jobc == 0 &&
prop & SIGPROP_TTYSTOP))
(prop & SIGPROP_TTYSTOP) != 0))
break; /* == ignore */
if (TD_SBDRY_INTR(td)) {
KASSERT((td->td_flags & TDF_SBDRY) != 0,

View File

@ -456,7 +456,7 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig)
}
pg = p->p_pgrp;
if (p->p_flag & P_PPWAIT || pg->pg_jobc == 0) {
if ((p->p_flag & P_PPWAIT) != 0 || pg->pg_jobc == 0) {
/* Don't allow the action to happen. */
PROC_UNLOCK(p);
return (EIO);