summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 450aab602cc3..cb6e7b28fa48 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -334,10 +334,11 @@ exit1(struct thread *td, int rv)
tty_unlock(tp);
}
- if (ttyvp != NULL && ttyvp->v_type != VBAD) {
+ if (ttyvp != NULL) {
sx_xunlock(&proctree_lock);
- VOP_LOCK(ttyvp, LK_EXCLUSIVE);
- VOP_REVOKE(ttyvp, REVOKEALL);
+ vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY);
+ if (ttyvp->v_type != VBAD)
+ VOP_REVOKE(ttyvp, REVOKEALL);
VOP_UNLOCK(ttyvp, 0);
sx_xlock(&proctree_lock);
}