aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--i386/i386at/lpr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 73c4261b..8303be59 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -232,7 +232,7 @@ void lprstart(struct tty *tp)
spl_t s = spltty();
u_short addr = (natural_t) tp->t_addr;
int status = inb(STATUS(addr));
- char nch;
+ int nch;
if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP|TS_BUSY)) {
splx(s);
@@ -253,6 +253,10 @@ void lprstart(struct tty *tp)
return;
}
nch = getc(&tp->t_outq);
+ if (nch == -1) {
+ splx(s);
+ return;
+ }
if ((tp->t_flags & LITOUT) == 0 && (nch & 0200)) {
timeout((timer_func_t *)ttrstrt, (char *)tp, (nch & 0x7f) + 6);
tp->t_state |= TS_TIMEOUT;