From ed2d0915255cd09de58731fa8c93cd47ec065437 Mon Sep 17 00:00:00 2001 From: Mike Karels Date: Sat, 21 Feb 1987 23:13:02 -0800 Subject: [PATCH] virtual consoles SCCS-vsn: sys/kern/subr_prf.c 7.4 --- usr/src/sys/kern/subr_prf.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/usr/src/sys/kern/subr_prf.c b/usr/src/sys/kern/subr_prf.c index 3769b4a8b6..338d052e16 100644 --- a/usr/src/sys/kern/subr_prf.c +++ b/usr/src/sys/kern/subr_prf.c @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)subr_prf.c 7.3 (Berkeley) %G% + * @(#)subr_prf.c 7.4 (Berkeley) %G% */ #include "../machine/mtpr.h" @@ -33,6 +33,11 @@ */ char *panicstr; +extern cnputc(); /* standard console putc */ +extern struct tty cons; /* standard console tty */ +struct tty *constty; /* pointer to console "window" tty */ +int (*v_putc)() = cnputc; /* routine to putc on virtual console */ + extern cnputc(); /* standard console putc */ extern struct tty cons; /* standard console tty */ struct tty *constty; /* pointer to console "window" tty */ @@ -324,7 +329,14 @@ putchar(c, flags, tp) register int c; struct tty *tp; { + int startflags = flags; + if (panicstr) + constty = 0; + if ((flags & TOCONS) && tp == 0 && constty) { + tp = constty; + flags |= TOTTY; + } if ((flags & TOCONS) && panicstr == 0 && tp == 0 && constty) { tp = constty; flags |= TOTTY; @@ -360,6 +372,5 @@ putchar(c, flags, tp) if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE) msgbuf.msg_bufx = 0; } - if ((flags & TOCONS) && c != '\0') (*v_console)(c); } -- 2.20.1