diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2020-12-31 00:45:47 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-01-10 02:41:19 +0000 |
commit | 993a1699b1948d30c4903440e8d8b23a7d5fc6c5 (patch) | |
tree | 69bf2b99e23f920c46d1fa7c13d027bb90973a1f | |
parent | 811f08c1cf417306fd9590e062625ca847cb572c (diff) | |
download | src-993a1699b1948d30c4903440e8d8b23a7d5fc6c5.tar.gz src-993a1699b1948d30c4903440e8d8b23a7d5fc6c5.zip |
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
-rw-r--r-- | sys/kern/kern_proc.c | 8 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 12 | ||||
-rw-r--r-- | sys/kern/tty.c | 2 |
3 files changed, 10 insertions, 12 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index abc3206c5a26..ea34631995b1 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -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); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ed4dd52b66d3..b1b4ccf4357c 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -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, diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 8d4d25a4ac0b..af4aebd18979 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -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); |