Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 2021 01:14:25 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 7aca3f4a7754 - stable/12 - Style. Improve some KASSERTs messages.
Message-ID:  <202101130114.10D1EPCB048821@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=7aca3f4a77542ca4fc1575de9366eeeacb62a331

commit 7aca3f4a77542ca4fc1575de9366eeeacb62a331
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2020-12-31 00:45:47 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-01-13 01:08:26 +0000

    Style.  Improve some KASSERTs messages.
    
    (cherry picked from commit 993a1699b1948d30c4903440e8d8b23a7d5fc6c5)
---
 sys/kern/kern_proc.c |  8 +++-----
 sys/kern/kern_sig.c  | 12 ++++++------
 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 a4cc1825e31f..566b9a8ea43a 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -533,12 +533,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 74647ca6822a..b84793285d8a 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2208,9 +2208,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);
@@ -2950,10 +2950,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 f82c1feca021..63324ac3e881 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -446,7 +446,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101130114.10D1EPCB048821>