mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 16:50:25 -04:00
tty: replace several curthread->td_proc with stored curproc
No functional changes.
This commit is contained in:
parent
1ae9c994c8
commit
aa0e2887f4
1 changed files with 7 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue