bug fixes (kludge round 1)
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Tue, 26 Jan 1982 10:39:43 +0000 (02:39 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Tue, 26 Jan 1982 10:39:43 +0000 (02:39 -0800)
SCCS-vsn: sys/kern/tty.c 4.20

usr/src/sys/kern/tty.c

index 3bf96aa..c2ac7ad 100644 (file)
@@ -1,4 +1,4 @@
-/*     tty.c   4.19    82/01/24        */
+/*     tty.c   4.20    82/01/25        */
 
 /*
  * TTY subroutines common to more than one line discipline
 
 /*
  * TTY subroutines common to more than one line discipline
@@ -86,7 +86,8 @@ wflushtty(tp)
 {
 
        (void) spl5();
 {
 
        (void) spl5();
-       while (tp->t_outq.c_cc && tp->t_state&TS_CARR_ON) {
+       while (tp->t_outq.c_cc && tp->t_state&TS_CARR_ON
+           && tp->t_oproc) {           /* kludge for pty */
                (*tp->t_oproc)(tp);
                tp->t_state |= TS_ASLEEP;
                sleep((caddr_t)&tp->t_outq, TTOPRI);
                (*tp->t_oproc)(tp);
                tp->t_state |= TS_ASLEEP;
                sleep((caddr_t)&tp->t_outq, TTOPRI);
@@ -178,7 +179,8 @@ register struct tty *tp;
        register s;
 
        s = spl5();
        register s;
 
        s = spl5();
-       if((tp->t_state&(TS_TIMEOUT|TS_TTSTOP|TS_BUSY)) == 0)
+       if((tp->t_state&(TS_TIMEOUT|TS_TTSTOP|TS_BUSY)) == 0 &&
+           tp->t_oproc)                /* kludge for pty */
                (*tp->t_oproc)(tp);
        splx(s);
 }
                (*tp->t_oproc)(tp);
        splx(s);
 }