diff options
author | mjg <mjg@FreeBSD.org> | 2015-07-06 18:53:56 +0000 |
---|---|---|
committer | mjg <mjg@FreeBSD.org> | 2015-07-06 18:53:56 +0000 |
commit | 29181895d56800d19825c2c473d5d8f1521fd358 (patch) | |
tree | 75484b1c75713cf8f5a175d44d38d5b099517c9d | |
parent | 5265baf79188cf2d7486f5201758a822de44f44e (diff) | |
download | FreeBSD-src-29181895d56800d19825c2c473d5d8f1521fd358.zip FreeBSD-src-29181895d56800d19825c2c473d5d8f1521fd358.tar.gz |
tty: replace several curthread->td_proc with stored curproc
No functional changes.
-rw-r--r-- | sys/kern/tty_tty.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index 07d8358..582b41a 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -58,25 +58,27 @@ static void ctty_clone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev) { + struct proc *p; if (*dev != NULL) return; if (strcmp(name, "tty")) return; + p = curproc; sx_sunlock(&clone_drain_lock); sx_slock(&proctree_lock); sx_slock(&clone_drain_lock); dev_lock(); - if (!(curthread->td_proc->p_flag & P_CONTROLT)) + if (!(p->p_flag & P_CONTROLT)) *dev = ctty; - else if (curthread->td_proc->p_session->s_ttyvp == NULL) + else if (p->p_session->s_ttyvp == NULL) *dev = ctty; - else if (curthread->td_proc->p_session->s_ttyvp->v_type == VBAD || - curthread->td_proc->p_session->s_ttyvp->v_rdev == NULL) { + else if (p->p_session->s_ttyvp->v_type == VBAD || + p->p_session->s_ttyvp->v_rdev == NULL) { /* e.g. s_ttyvp was revoked */ *dev = ctty; } else - *dev = curthread->td_proc->p_session->s_ttyvp->v_rdev; + *dev = p->p_session->s_ttyvp->v_rdev; dev_refl(*dev); dev_unlock(); sx_sunlock(&proctree_lock); |