tsleep: unwind after signal interrupts; close routines must return value
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 4 Apr 1990 13:17:10 +0000 (05:17 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 4 Apr 1990 13:17:10 +0000 (05:17 -0800)
SCCS-vsn: sys/vax/uba/dmx.c 1.5

usr/src/sys/vax/uba/dmx.c

index edfc7ac..3ac71e1 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       1.4 (Berkeley) %G%
+ *     @(#)dmx.c       1.5 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -32,7 +32,6 @@
 #include "uio.h"
 #include "kernel.h"
 #include "syslog.h"
 #include "uio.h"
 #include "kernel.h"
 #include "syslog.h"
-#include "tsleep.h"
 
 #include "dmx.h"
 #include "ubareg.h"
 
 #include "dmx.h"
 #include "ubareg.h"
@@ -88,7 +87,7 @@ dmxopen(tp, sc, flag)
        register struct tty *tp;
        register struct dmx_softc *sc;
 {
        register struct tty *tp;
        register struct dmx_softc *sc;
 {
-       int s, unit;
+       int s, unit, error = 0;
        int dmxparam();
 
        s = spltty();
        int dmxparam();
 
        s = spltty();
@@ -134,9 +133,13 @@ dmxopen(tp, sc, flag)
                    tp->t_cflag&CLOCAL)
                        break;
                tp->t_state |= TS_WOPEN;
                    tp->t_cflag&CLOCAL)
                        break;
                tp->t_state |= TS_WOPEN;
-               tsleep((caddr_t)&tp->t_rawq, TTIPRI, SLP_DMX_OPN, 0);
+               if (error = tsleep((caddr_t)&tp->t_rawq, TTIPRI | PCATCH,
+                   ttopen, 0))
+                       break;
        }
        splx(s);
        }
        splx(s);
+       if (error)
+               return (error);
        return ((*linesw[tp->t_line].l_open)(tp->t_dev, tp));
 }
 
        return ((*linesw[tp->t_line].l_open)(tp->t_dev, tp));
 }
 
@@ -148,7 +151,7 @@ dmxclose(tp)
        (void) dmxmctl(tp, DMF_BRK, DMBIC);
        if (tp->t_cflag & HUPCL || (tp->t_state & TS_ISOPEN) == 0)
                (void) dmxmctl(tp, DMF_OFF, DMSET);
        (void) dmxmctl(tp, DMF_BRK, DMBIC);
        if (tp->t_cflag & HUPCL || (tp->t_state & TS_ISOPEN) == 0)
                (void) dmxmctl(tp, DMF_OFF, DMSET);
-       ttyclose(tp);
+       return (ttyclose(tp));
 }
 
 dmxrint(sc)
 }
 
 dmxrint(sc)