--- src/sys/kern/tty_tty.c 2004/11/12 00:09:24 1.11 +++ src/sys/kern/tty_tty.c 2005/01/29 05:48:17 1.12 @@ -95,6 +95,8 @@ cttyopen(dev_t dev, int flag, int mode, vsetflags(ttyvp, VCTTYISOPEN); vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY, td); error = VOP_OPEN(ttyvp, flag, NOCRED, NULL, td); + if (error) + vclrflags(ttyvp, VCTTYISOPEN); VOP_UNLOCK(ttyvp, 0, td); } } else {