Remove the need for some untimeouts.

This commit is contained in:
mycroft 1994-10-12 13:38:16 +00:00
parent 5b951fb823
commit 8f5b447fb2
1 changed files with 2 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty.c,v 1.52 1994/09/18 18:32:51 deraadt Exp $ */ /* $NetBSD: tty.c,v 1.53 1994/10/12 13:38:16 mycroft Exp $ */
/*- /*-
* Copyright (c) 1982, 1986, 1990, 1991, 1993 * Copyright (c) 1982, 1986, 1990, 1991, 1993
@ -1295,7 +1295,6 @@ loop: lflag = tp->t_lflag;
* Also, use plain wakeup() not ttwakeup(). * Also, use plain wakeup() not ttwakeup().
*/ */
slp = (long) (((u_long)slp * hz) + 999999) / 1000000; slp = (long) (((u_long)slp * hz) + 999999) / 1000000;
timeout(wakeup, (caddr_t)qp, slp);
goto sleep; goto sleep;
} }
} else if ((qp = &tp->t_canq)->c_cc <= 0) { } else if ((qp = &tp->t_canq)->c_cc <= 0) {
@ -1310,21 +1309,15 @@ sleep:
carrier = ISSET(tp->t_state, TS_CARR_ON) || carrier = ISSET(tp->t_state, TS_CARR_ON) ||
ISSET(tp->t_cflag, CLOCAL); ISSET(tp->t_cflag, CLOCAL);
if (!carrier && ISSET(tp->t_state, TS_ISOPEN)) { if (!carrier && ISSET(tp->t_state, TS_ISOPEN)) {
if (slp)
untimeout(wakeup, (caddr_t)qp);
splx(s); splx(s);
return (0); /* EOF */ return (0); /* EOF */
} }
if (flag & IO_NDELAY) { if (flag & IO_NDELAY) {
if (slp)
untimeout(wakeup, (caddr_t)qp);
splx(s); splx(s);
return (EWOULDBLOCK); return (EWOULDBLOCK);
} }
error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH, error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH,
carrier ? ttyin : ttopen, 0); carrier ? ttyin : ttopen, slp);
if (slp)
untimeout(wakeup, (caddr_t)qp);
splx(s); splx(s);
if (error) if (error)
return (error); return (error);