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>
This commit is contained in:
Ed Schouten 2008-12-21 21:54:01 +00:00
parent 67dd0ccbee
commit 3a4d0c86aa

View File

@ -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);