34c34
< * $FreeBSD: head/sys/kern/tty_tty.c 83366 2001-09-12 08:38:13Z julian $
---
> * $FreeBSD: head/sys/kern/tty_tty.c 91140 2002-02-23 11:12:57Z tanimura $
45a46,47
> #include <sys/mutex.h>
> #include <sys/sx.h>
83c85
< struct vnode *ttyvp = cttyvp(td);
---
> struct vnode *ttyvp;
85a88,93
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
102c110
< register struct vnode *ttyvp = cttyvp(td);
---
> register struct vnode *ttyvp;
104a113,118
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
121c135
< struct vnode *ttyvp = cttyvp(uio->uio_td);
---
> struct vnode *ttyvp;
124a139,144
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
147c167,168
< struct vnode *ttyvp = cttyvp(td);
---
> struct vnode *ttyvp;
> int error;
148a170,175
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
154c181,184
< if (!SESS_LEADER(td->td_proc)) {
---
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> error = 0;
> if (!SESS_LEADER(td->td_proc))
156,158c186,190
< return (0);
< } else
< return (EINVAL);
---
> else
> error = EINVAL;
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
> return (error);
170c202
< struct vnode *ttyvp = cttyvp(td);
---
> struct vnode *ttyvp;
171a204,209
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
< * $FreeBSD: head/sys/kern/tty_tty.c 83366 2001-09-12 08:38:13Z julian $
---
> * $FreeBSD: head/sys/kern/tty_tty.c 91140 2002-02-23 11:12:57Z tanimura $
45a46,47
> #include <sys/mutex.h>
> #include <sys/sx.h>
83c85
< struct vnode *ttyvp = cttyvp(td);
---
> struct vnode *ttyvp;
85a88,93
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
102c110
< register struct vnode *ttyvp = cttyvp(td);
---
> register struct vnode *ttyvp;
104a113,118
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
121c135
< struct vnode *ttyvp = cttyvp(uio->uio_td);
---
> struct vnode *ttyvp;
124a139,144
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
147c167,168
< struct vnode *ttyvp = cttyvp(td);
---
> struct vnode *ttyvp;
> int error;
148a170,175
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>
154c181,184
< if (!SESS_LEADER(td->td_proc)) {
---
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> error = 0;
> if (!SESS_LEADER(td->td_proc))
156,158c186,190
< return (0);
< } else
< return (EINVAL);
---
> else
> error = EINVAL;
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
> return (error);
170c202
< struct vnode *ttyvp = cttyvp(td);
---
> struct vnode *ttyvp;
171a204,209
> PROC_LOCK(td->td_proc);
> SESS_LOCK(td->td_proc->p_session);
> ttyvp = cttyvp(td);
> SESS_UNLOCK(td->td_proc->p_session);
> PROC_UNLOCK(td->td_proc);
>