39c39
< * $FreeBSD: head/sys/kern/vfs_vnops.c 90946 2002-02-20 00:11:57Z rwatson $
---
> * $FreeBSD: head/sys/kern/vfs_vnops.c 91140 2002-02-23 11:12:57Z tanimura $
621a622
> struct vnode *vpold;
659c660,662
< if (td->td_proc->p_session->s_ttyvp == vp)
---
> PGRPSESS_XLOCK();
> if (td->td_proc->p_session->s_ttyvp == vp) {
> PGRPSESS_XUNLOCK();
660a664
> }
662,666c666
< /* Get rid of reference to old control tty */
< if (td->td_proc->p_session->s_ttyvp)
< vrele(td->td_proc->p_session->s_ttyvp);
<
< td->td_proc->p_session->s_ttyvp = vp;
---
> vpold = td->td_proc->p_session->s_ttyvp;
667a668,676
> SESS_LOCK(td->td_proc->p_session);
> td->td_proc->p_session->s_ttyvp = vp;
> SESS_UNLOCK(td->td_proc->p_session);
>
> PGRPSESS_XUNLOCK();
>
> /* Get rid of reference to old control tty */
> if (vpold)
> vrele(vpold);
< * $FreeBSD: head/sys/kern/vfs_vnops.c 90946 2002-02-20 00:11:57Z rwatson $
---
> * $FreeBSD: head/sys/kern/vfs_vnops.c 91140 2002-02-23 11:12:57Z tanimura $
621a622
> struct vnode *vpold;
659c660,662
< if (td->td_proc->p_session->s_ttyvp == vp)
---
> PGRPSESS_XLOCK();
> if (td->td_proc->p_session->s_ttyvp == vp) {
> PGRPSESS_XUNLOCK();
660a664
> }
662,666c666
< /* Get rid of reference to old control tty */
< if (td->td_proc->p_session->s_ttyvp)
< vrele(td->td_proc->p_session->s_ttyvp);
<
< td->td_proc->p_session->s_ttyvp = vp;
---
> vpold = td->td_proc->p_session->s_ttyvp;
667a668,676
> SESS_LOCK(td->td_proc->p_session);
> td->td_proc->p_session->s_ttyvp = vp;
> SESS_UNLOCK(td->td_proc->p_session);
>
> PGRPSESS_XUNLOCK();
>
> /* Get rid of reference to old control tty */
> if (vpold)
> vrele(vpold);