tp->tty_outcum += count;
if ((tp->tty_outleft -= count) == 0) {
/* Output is finished, reply to the writer. */
- chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
- tp->tty_outcum);
+ if (tp->tty_outcaller != KERNEL)
+ chardriver_reply_task(tp->tty_outcaller,
+ tp->tty_outid, tp->tty_outcum);
tp->tty_outcum = 0;
tp->tty_outcaller = NONE;
}
}
if (tp->tty_outleft > 0 && tp->tty_termios.c_ospeed == B0) {
/* Oops, the line has hung up. */
- chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO);
+ if (tp->tty_outcaller != KERNEL)
+ chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
+ EIO);
tp->tty_outleft = tp->tty_outcum = 0;
tp->tty_outcaller = NONE;
}
flush(cons); /* transfer anything buffered to the screen */
- /* Reply to the writer if all output is finished or if an error occured. */
+ /* Reply to the writer if all output is finished or if an error occurred. */
if (tp->tty_outleft == 0 || result != OK) {
- chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
- result != OK ? result : tp->tty_outcum);
+ if (tp->tty_outcaller != KERNEL)
+ chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
+ result != OK ? result : tp->tty_outcum);
tp->tty_outcum = tp->tty_outleft = 0;
tp->tty_outcaller = NONE;
}
tp->tty_outcum += count;
if ((tp->tty_outleft -= count) == 0) {
/* Output is finished, reply to the writer. */
- chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
- tp->tty_outcum);
+ if (tp->tty_outcaller != KERNEL)
+ chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
+ tp->tty_outcum);
tp->tty_outcum = 0;
tp->tty_outcaller = NONE;
}
}
if (tp->tty_outleft > 0 && tp->tty_termios.c_ospeed == B0) {
/* Oops, the line has hung up. */
- chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO);
+ if (tp->tty_outcaller != KERNEL)
+ chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO);
tp->tty_outleft = tp->tty_outcum = 0;
tp->tty_outcaller = NONE;
}