From 80f1c58b0a57fec2f89e018a2a2fb8c4fcf61f2b Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sun, 16 Oct 2011 14:16:46 +0000 Subject: [PATCH] Fix double vision syndrome (read: double output) when in the debugger without a panic. --- sys/kern/subr_prf.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 48f2dd9ce8a..d8e8e0582a7 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -467,25 +467,19 @@ putchar(int c, void *arg) struct putchar_arg *ap = (struct putchar_arg*) arg; struct tty *tp = ap->tty; int flags = ap->flags; - int putbuf_done = 0; /* Don't use the tty code after a panic or while in ddb. */ if (kdb_active) { if (c != '\0') cnputc(c); - } else { - if ((panicstr == NULL) && (flags & TOTTY) && (tp != NULL)) - tty_putchar(tp, c); + return; + } - if (flags & TOCONS) { - putbuf(c, ap); - putbuf_done = 1; - } - } - if ((flags & TOLOG) && (putbuf_done == 0)) { - if (c != '\0') - putbuf(c, ap); - } + if ((flags & TOTTY) && tp != NULL && panicstr == NULL) + tty_putchar(tp, c); + + if ((flags & (TOCONS | TOLOG)) && c != '\0') + putbuf(c, ap); } /*