check for revoked terminal (ttclosed)
[unix-history] / usr / src / sys / vax / uba / dhu.c
index 64eef39..15de6c8 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)dhu.c       7.10 (Berkeley) %G%
+ *     @(#)dhu.c       7.11 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -261,8 +261,9 @@ dhuopen(dev, flag)
        while ((flag&O_NONBLOCK) == 0 && (tp->t_cflag&CLOCAL) == 0 &&
            (tp->t_state & TS_CARR_ON) == 0) {
                tp->t_state |= TS_WOPEN;
        while ((flag&O_NONBLOCK) == 0 && (tp->t_cflag&CLOCAL) == 0 &&
            (tp->t_state & TS_CARR_ON) == 0) {
                tp->t_state |= TS_WOPEN;
-               if (error = tsleep((caddr_t)&tp->t_rawq, TTIPRI | PCATCH,
-                   ttopen, 0))
+               if ((error = tsleep((caddr_t)&tp->t_rawq, TTIPRI | PCATCH,
+                                   ttopen, 0)) ||
+                   (error = ttclosed(tp)))
                        break;
        }
        (void) splx(s);
                        break;
        }
        (void) splx(s);