summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-12-21 21:54:01 +0000
committered <ed@FreeBSD.org>2008-12-21 21:54:01 +0000
commitc48b61a389020acf4ab85f00bc3a05fac8d07ecf (patch)
tree5f40d1f2f51aa362b70a6dc665eaee0eab52ec02 /sys
parent8cd1b937417632dbc19c54113e5fad066faa9952 (diff)
downloadFreeBSD-src-c48b61a389020acf4ab85f00bc3a05fac8d07ecf.zip
FreeBSD-src-c48b61a389020acf4ab85f00bc3a05fac8d07ecf.tar.gz
Revert r185891.
In r185891 I removed the newlines from messages written to /dev/console, because it made startup messages from rc-scripts harder to read. This, unfortunately, causes the kernel message that is printed after a non-terminated log message to be concatenated. This could be fixed, but on short term it's better to just revert the change. Reported by: Jaakko Heinonen <jh saunalahti fi>
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_prf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 9614a27..0057d9a 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -257,7 +257,7 @@ log(int level, const char *fmt, ...)
void
log_console(struct uio *uio)
{
- int c, i, error;
+ int c, i, error, nl;
char *consbuffer;
int pri;
@@ -268,14 +268,22 @@ log_console(struct uio *uio)
uio = cloneuio(uio);
consbuffer = malloc(CONSCHUNK, M_TEMP, M_WAITOK);
+ nl = 0;
while (uio->uio_resid > 0) {
c = imin(uio->uio_resid, CONSCHUNK);
error = uiomove(consbuffer, c, uio);
if (error != 0)
break;
- for (i = 0; i < c; i++)
+ for (i = 0; i < c; i++) {
msglogchar(consbuffer[i], pri);
+ if (consbuffer[i] == '\n')
+ nl = 1;
+ else
+ nl = 0;
+ }
}
+ if (!nl)
+ msglogchar('\n', pri);
msgbuftrigger = 1;
free(uio, M_IOV);
free(consbuffer, M_TEMP);
OpenPOWER on IntegriCloud