diff options
author | ed <ed@FreeBSD.org> | 2009-02-27 12:50:25 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-02-27 12:50:25 +0000 |
commit | 2078a09b34868de14884530615367f198f95ab7e (patch) | |
tree | 7c95974ee31687fd5d93f47d9e65d8f0f0ca18b3 | |
parent | 50b3c45b0e9ac67c5ed800e392b2343093f27d70 (diff) | |
download | FreeBSD-src-2078a09b34868de14884530615367f198f95ab7e.zip FreeBSD-src-2078a09b34868de14884530615367f198f95ab7e.tar.gz |
Revert previous commit to subr_prf.c and make it more tidy.
As mentioned by bz and bde, the change I made wasn't the proper way to
fix. Inspired by bde's patch, perform some small cleanups to uprintf().
Reviewed by: bz
-rw-r--r-- | sys/kern/subr_prf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index eabf521..c311120 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -127,16 +127,18 @@ tablefull(const char *tab) int uprintf(const char *fmt, ...) { - struct thread *td = curthread; - struct proc *p = td->td_proc; va_list ap; struct putchar_arg pca; + struct proc *p; + struct thread *td; int retval; - if (td == NULL || TD_IS_IDLETHREAD(td)) + td = curthread; + if (TD_IS_IDLETHREAD(td)) return (0); sx_slock(&proctree_lock); + p = td->td_proc; PROC_LOCK(p); if ((p->p_flag & P_CONTROLT) == 0) { PROC_UNLOCK(p); |