check for revoked terminal (ttclosed)
authorMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Thu, 7 Jun 1990 08:48:59 +0000 (00:48 -0800)
committerMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Thu, 7 Jun 1990 08:48:59 +0000 (00:48 -0800)
SCCS-vsn: sys/hp300/dev/dcm.c 7.3
SCCS-vsn: sys/hp/dev/dca.c 7.3
SCCS-vsn: sys/vax/uba/dz.c 7.8
SCCS-vsn: sys/vax/uba/dmx.c 7.3
SCCS-vsn: sys/vax/uba/dhu.c 7.11
SCCS-vsn: sys/vax/uba/dh.c 7.13
SCCS-vsn: sys/tahoe/vba/vx.c 7.7
SCCS-vsn: sys/tahoe/vba/mp.c 7.12

usr/src/sys/hp/dev/dca.c
usr/src/sys/hp300/dev/dcm.c
usr/src/sys/tahoe/vba/mp.c
usr/src/sys/tahoe/vba/vx.c
usr/src/sys/vax/uba/dh.c
usr/src/sys/vax/uba/dhu.c
usr/src/sys/vax/uba/dmx.c
usr/src/sys/vax/uba/dz.c

index cbc9f53..67f189e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)dca.c       7.2 (Berkeley) %G%
+ *     @(#)dca.c       7.3 (Berkeley) %G%
  */
 
 #include "dca.h"
  */
 
 #include "dca.h"
@@ -159,8 +159,9 @@ dcaopen(dev, flag)
        while (!(flag&O_NONBLOCK) && !(tp->t_cflag&CLOCAL) &&
               (tp->t_state & TS_CARR_ON) == 0) {
                tp->t_state |= TS_WOPEN;
        while (!(flag&O_NONBLOCK) && !(tp->t_cflag&CLOCAL) &&
               (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))) {
                        tp->t_state &= ~TS_WOPEN;
                        (void) spl0();
                        return (error);
                        tp->t_state &= ~TS_WOPEN;
                        (void) spl0();
                        return (error);
index ad8ee1e..5045aaf 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: $Hdr: dcm.c 1.17 89/10/01$
  *
  *
  * from: $Hdr: dcm.c 1.17 89/10/01$
  *
- *     @(#)dcm.c       7.2 (Berkeley) %G%
+ *     @(#)dcm.c       7.3 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -288,8 +288,9 @@ dcmopen(dev, flag)
        while (!(flag&O_NONBLOCK) && !(tp->t_cflag&CLOCAL) &&
               (tp->t_state & TS_CARR_ON) == 0) {
                tp->t_state |= TS_WOPEN;
        while (!(flag&O_NONBLOCK) && !(tp->t_cflag&CLOCAL) &&
               (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))) {
                        tp->t_state &= ~TS_WOPEN;
                        (void) spl0();
                        return (error);
                        tp->t_state &= ~TS_WOPEN;
                        (void) spl0();
                        return (error);
index 07d2a61..169555b 100644 (file)
@@ -17,7 +17,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)mp.c        7.11 (Berkeley) %G%
+ *     @(#)mp.c        7.12 (Berkeley) %G%
  */
 
 #include "mp.h"
  */
 
 #include "mp.h"
@@ -258,8 +258,9 @@ restart:
        }
        while ((mode&O_NONBLOCK) == 0 && (tp->t_cflag&CLOCAL) == 0 &&  
            (tp->t_state & TS_CARR_ON) == 0) {
        }
        while ((mode&O_NONBLOCK) == 0 && (tp->t_cflag&CLOCAL) == 0 &&  
            (tp->t_state & TS_CARR_ON) == 0) {
-               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)))
                        goto bad;
                /*
                 * a mpclose() might have disabled port. if so restart
                        goto bad;
                /*
                 * a mpclose() might have disabled port. if so restart
index 417a4a1..7261441 100644 (file)
@@ -17,7 +17,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)vx.c        7.6 (Berkeley) %G%
+ *     @(#)vx.c        7.7 (Berkeley) %G%
  */
 
 #include "vx.h"
  */
 
 #include "vx.h"
@@ -242,8 +242,9 @@ vxopen(dev, flag)
        vcmodem(dev, VMOD_ON);
        while (!(flag&O_NONBLOCK) && !(tp->t_cflag&CLOCAL) && 
              (tp->t_state&TS_CARR_ON) == 0)
        vcmodem(dev, VMOD_ON);
        while (!(flag&O_NONBLOCK) && !(tp->t_cflag&CLOCAL) && 
              (tp->t_state&TS_CARR_ON) == 0)
-               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;
        if (error == 0)
                error = (*linesw[tp->t_line].l_open)(dev,tp);
                        break;
        if (error == 0)
                error = (*linesw[tp->t_line].l_open)(dev,tp);
index 39b5d0e..ea1632a 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.
  *
- *     @(#)dh.c        7.12 (Berkeley) %G%
+ *     @(#)dh.c        7.13 (Berkeley) %G%
  */
 
 #include "dh.h"
  */
 
 #include "dh.h"
@@ -734,8 +734,9 @@ dmopen(dev, flag)
                if (tp->t_state&TS_CARR_ON || flag&O_NONBLOCK || 
                    tp->t_cflag&CLOCAL)
                        break;
                if (tp->t_state&TS_CARR_ON || flag&O_NONBLOCK || 
                    tp->t_cflag&CLOCAL)
                        break;
-               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;
        }
        splx(s);
                        break;
        }
        splx(s);
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);
index 2c08aa3..118b92d 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.
  *
- *     @(#)dmx.c       7.2 (Berkeley) %G%
+ *     @(#)dmx.c       7.3 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -132,8 +132,9 @@ dmxopen(tp, sc, flag)
                    tp->t_cflag&CLOCAL)
                        break;
                tp->t_state |= TS_WOPEN;
                    tp->t_cflag&CLOCAL)
                        break;
                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;
        }
        splx(s);
                        break;
        }
        splx(s);
index 8401191..f42fc2c 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.
  *
- *     @(#)dz.c        7.7 (Berkeley) %G%
+ *     @(#)dz.c        7.8 (Berkeley) %G%
  */
 
 #include "dz.h"
  */
 
 #include "dz.h"
@@ -189,8 +189,9 @@ dzopen(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) spl0();
                        break;
        }
        (void) spl0();