From 2a96b2d69fa84970ae0c8c6fe2516b91ddb50d32 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Thu, 26 Sep 2002 02:54:30 +0000 Subject: [PATCH] - Fix a botch in previous commit; oldvp should not be unconditionally assigned. --- sys/fs/specfs/spec_vnops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index e37096fd009b..790a54317fdd 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -608,11 +608,12 @@ spec_close(ap) if (td && vp == td->td_proc->p_session->s_ttyvp) { SESS_LOCK(td->td_proc->p_session); VI_LOCK(vp); - if (vcount(vp) == 2 && (vp->v_iflag & VI_XLOCK) == 0) + if (vcount(vp) == 2 && (vp->v_iflag & VI_XLOCK) == 0) { td->td_proc->p_session->s_ttyvp = NULL; + oldvp = vp; + } VI_UNLOCK(vp); SESS_UNLOCK(td->td_proc->p_session); - oldvp = vp; } sx_xunlock(&proctree_lock); if (oldvp != NULL)