diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 1923499f69dd..e918d1cfd187 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1370,14 +1370,14 @@ tty_wait(struct tty *tp, struct cv *cv) error = cv_wait_sig(cv, tp->t_mtx); - /* Restart the system call when we may have been revoked. */ - if (tp->t_revokecnt != revokecnt) - return (ERESTART); - /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); + /* Restart the system call when we may have been revoked. */ + if (tp->t_revokecnt != revokecnt) + return (ERESTART); + return (error); }