subr_prf.c (937b352e23839361e7bcbc84d0e180c1c3bb9285) subr_prf.c (7e99c034f788128c7d168eaf27af9a3acaa06163)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1986, 1988, 1991, 1993
5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph

--- 165 unchanged lines hidden (view full) ---

174 struct proc *p;
175 struct thread *td;
176 int retval;
177
178 td = curthread;
179 if (TD_IS_IDLETHREAD(td))
180 return (0);
181
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1986, 1988, 1991, 1993
5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph

--- 165 unchanged lines hidden (view full) ---

174 struct proc *p;
175 struct thread *td;
176 int retval;
177
178 td = curthread;
179 if (TD_IS_IDLETHREAD(td))
180 return (0);
181
182 if (td->td_proc == initproc) {
183 /* Produce output when we fail to load /sbin/init: */
184 va_start(ap, fmt);
185 retval = vprintf(fmt, ap);
186 va_end(ap);
187 return (retval);
188 }
189
182 sx_slock(&proctree_lock);
183 p = td->td_proc;
184 PROC_LOCK(p);
185 if ((p->p_flag & P_CONTROLT) == 0) {
186 PROC_UNLOCK(p);
187 sx_sunlock(&proctree_lock);
188 return (0);
189 }

--- 1112 unchanged lines hidden ---
190 sx_slock(&proctree_lock);
191 p = td->td_proc;
192 PROC_LOCK(p);
193 if ((p->p_flag & P_CONTROLT) == 0) {
194 PROC_UNLOCK(p);
195 sx_sunlock(&proctree_lock);
196 return (0);
197 }

--- 1112 unchanged lines hidden ---