- if (flags & TOTTY) {
- register s = spltty();
-
- if (tp && (tp->t_state & (TS_CARR_ON | TS_ISOPEN)) ==
- (TS_CARR_ON | TS_ISOPEN)) {
- if (c == '\n')
- (void) ttyoutput('\r', tp);
- (void) ttyoutput(c, tp);
- ttstart(tp);
- flags &= ~TOCONS;
- } else if ((flags & TOCONS) && tp == constty)
- constty = 0;
- splx(s);
- }
- /*
- * Can send to log only after memory management enabled:
- * this has happened by the time maxmem is set.
- */
- if ((flags & TOLOG) && c != '\0' && c != '\r' && c != 0177 && maxmem) {
+ if ((flags & TOTTY) && where && tputchar(c, (struct tty *)where) < 0 &&
+ (flags & TOCONS) && (struct tty *)where == constty)
+ constty = 0;
+ if ((flags & TOLOG) && c != '\0' && c != '\r' && c != 0177 &&
+ msgbufmapped) {