summaryrefslogtreecommitdiff
path: root/sys/kern/subr_prf.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-04-14 21:58:51 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-04-14 21:58:51 +0000
commit994cb8839e7244de556e8fe53247392b0ed6cdfc (patch)
tree170c3a6f411478d8f521873652434215466052a5 /sys/kern/subr_prf.c
parentb27a36dbfa5518ff1240fbc7739730e82464401d (diff)
Try to start log message buffer on a new line. Helps install scripts avoid
detecting phantom devices when scanning dmesg output. Suggested by miod@, ok deraadt@.
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r--sys/kern/subr_prf.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index e4d04aa0bc7..8c5edfab33e 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_prf.c,v 1.60 2004/07/20 20:19:52 art Exp $ */
+/* $OpenBSD: subr_prf.c,v 1.61 2005/04/14 21:58:50 krw Exp $ */
/* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */
/*-
@@ -335,7 +335,6 @@ void
kputchar(int c, int flags, struct tty *tp)
{
extern int msgbufmapped;
- struct msgbuf *mbp;
if (panicstr)
constty = NULL;
@@ -347,21 +346,8 @@ kputchar(int c, int flags, struct tty *tp)
(flags & TOCONS) && tp == constty)
constty = NULL;
if ((flags & TOLOG) &&
- c != '\0' && c != '\r' && c != 0177 && msgbufmapped) {
- mbp = msgbufp;
- if (mbp->msg_magic != MSG_MAGIC) {
- /* Nothing we can do */
- }
- mbp->msg_bufc[mbp->msg_bufx++] = c;
- mbp->msg_bufl = min(mbp->msg_bufl+1, mbp->msg_bufs);
- if (mbp->msg_bufx < 0 || mbp->msg_bufx >= mbp->msg_bufs)
- mbp->msg_bufx = 0;
- /* If the buffer is full, keep the most recent data. */
- if (mbp->msg_bufr == mbp->msg_bufx) {
- if (++mbp->msg_bufr >= mbp->msg_bufs)
- mbp->msg_bufr = 0;
- }
- }
+ c != '\0' && c != '\r' && c != 0177 && msgbufmapped)
+ msgbuf_putchar(c);
if ((flags & TOCONS) && constty == NULL && c != '\0')
(*v_putc)(c);
#ifdef DDB