svn commit: r342779 - head/sys/kern

Kristof Provost kp at FreeBSD.org
Fri Jan 4 21:12:19 UTC 2019


Author: kp
Date: Fri Jan  4 21:12:17 2019
New Revision: 342779
URL: https://svnweb.freebsd.org/changeset/base/342779

Log:
  Remove unneeded NULL check for td_ucred
  
  td_ucred is always set, so we don't need the ternary expression to check for
  it.

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Fri Jan  4 21:09:38 2019	(r342778)
+++ head/sys/kern/kern_sig.c	Fri Jan  4 21:12:17 2019	(r342779)
@@ -3100,7 +3100,7 @@ killproc(struct proc *p, char *why)
 	    p->p_comm);
 	log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n",
 	    p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id,
-	    p->p_ucred ? p->p_ucred->cr_uid : -1, why);
+	    p->p_ucred->cr_uid, why);
 	proc_wkilled(p);
 	kern_psignal(p, SIGKILL);
 }
@@ -3146,7 +3146,7 @@ sigexit(struct thread *td, int sig)
 			    "pid %d (%s), jid %d, uid %d: exited on "
 			    "signal %d%s\n", p->p_pid, p->p_comm,
 			    p->p_ucred->cr_prison->pr_id,
-			    td->td_ucred ? td->td_ucred->cr_uid : -1,
+			    td->td_ucred->cr_uid,
 			    sig &~ WCOREFLAG,
 			    sig & WCOREFLAG ? " (core dumped)" : "");
 	} else


More information about the svn-src-head mailing list