BSD 4_3_Reno release
[unix-history] / usr / src / sys / kern / subr_prf.c
index 21016b2..4b13fcd 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)subr_prf.c  7.19 (Berkeley) %G%
+ *     @(#)subr_prf.c  7.18 (Berkeley) 6/28/90
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -12,6 +12,7 @@
 #include "buf.h"
 #include "conf.h"
 #include "reboot.h"
 #include "buf.h"
 #include "conf.h"
 #include "reboot.h"
+#include "vm.h"
 #include "msgbuf.h"
 #include "user.h"
 #include "proc.h"
 #include "msgbuf.h"
 #include "user.h"
 #include "proc.h"
@@ -51,11 +52,6 @@ int  (*v_getc)() = cngetc;           /* "" getc from virtual console */
 int    (*v_poll)() = cnpoll;           /* kdb hook to enable input polling */
 #endif
 
 int    (*v_poll)() = cnpoll;           /* kdb hook to enable input polling */
 #endif
 
-extern cnputc();                       /* standard console putc */
-extern struct tty cons;                /* standard console tty */
-struct tty *constty;                   /* pointer to console "window" tty */
-int    (*v_console)() = cnputc;        /* routine to putc on virtual console */
-
 /*
  * Scaled down version of C Library printf.
  * Used to print diagnostic information directly on console tty.
 /*
  * Scaled down version of C Library printf.
  * Used to print diagnostic information directly on console tty.
@@ -370,7 +366,6 @@ putchar(c, flags, ttyp)
        register int c;
        struct tty *ttyp;
 {
        register int c;
        struct tty *ttyp;
 {
-       register struct msgbuf *mbp = msgbufp;
        extern int msgbufmapped;
 
        if (panicstr)
        extern int msgbufmapped;
 
        if (panicstr)
@@ -379,26 +374,23 @@ putchar(c, flags, ttyp)
                ttyp = constty;
                flags |= TOTTY;
        }
                ttyp = constty;
                flags |= TOTTY;
        }
-       if ((flags & TOCONS) && panicstr == 0 && tp == 0 && constty) {
-               tp = constty;
-               flags |= TOTTY;
-       }
        if ((flags & TOTTY) && ttyp && tputchar(c, ttyp) < 0 &&
            (flags & TOCONS) && ttyp == constty)
                constty = 0;
        if ((flags & TOLOG) && c != '\0' && c != '\r' && c != 0177 &&
            msgbufmapped) {
        if ((flags & TOTTY) && ttyp && tputchar(c, ttyp) < 0 &&
            (flags & TOCONS) && ttyp == constty)
                constty = 0;
        if ((flags & TOLOG) && c != '\0' && c != '\r' && c != 0177 &&
            msgbufmapped) {
-               if (mbp->msg_magic != MSG_MAGIC) {
+               if (msgbuf.msg_magic != MSG_MAGIC) {
                        register int i;
 
                        register int i;
 
-                       mbp->msg_magic = MSG_MAGIC;
-                       mbp->msg_bufx = mbp->msg_bufr = 0;
+                       msgbuf.msg_magic = MSG_MAGIC;
+                       msgbuf.msg_bufx = msgbuf.msg_bufr = 0;
                        for (i=0; i < MSG_BSIZE; i++)
                        for (i=0; i < MSG_BSIZE; i++)
-                               mbp->msg_bufc[i] = 0;
+                               msgbuf.msg_bufc[i] = 0;
                }
                }
-               mbp->msg_bufc[mbp->msg_bufx++] = c;
-               if (mbp->msg_bufx < 0 || mbp->msg_bufx >= MSG_BSIZE)
-                       mbp->msg_bufx = 0;
+               msgbuf.msg_bufc[msgbuf.msg_bufx++] = c;
+               if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE)
+                       msgbuf.msg_bufx = 0;
        }
        }
-               (*v_console)(c);
+       if ((flags & TOCONS) && constty == 0 && c != '\0')
+               (*v_putc)(c);
 }
 }