summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_prf.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-12-10 21:48:05 +0000
committered <ed@FreeBSD.org>2008-12-10 21:48:05 +0000
commit4400e3e1347538c7fbe0db7c802baf4b84a6d3e0 (patch)
tree3a7198dc29318d465efdef1ee8dab59cf09f3fb8 /sys/kern/subr_prf.c
parent0bf9254d64f792ce2345949c2d4586d26d34c57d (diff)
downloadFreeBSD-src-4400e3e1347538c7fbe0db7c802baf4b84a6d3e0.zip
FreeBSD-src-4400e3e1347538c7fbe0db7c802baf4b84a6d3e0.tar.gz
Remove added newlines from logged messages written to /dev/console.
The /dev/console device node logs all strings that are written to it. When the string does not contain a trailing newline, it appends one. I can imagine this was useful a long time ago, but with our current rc-scripts, it generates a whole bunch of messages that look like: | Configuring syscons: | blanktime | . By not appending the newlines, the output of `dmesg -a' is now (almost?) exactly the same as what the user will see on the console device (syscons, uart).
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r--sys/kern/subr_prf.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 0057d9a..9614a27 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, nl;
+ int c, i, error;
char *consbuffer;
int pri;
@@ -268,22 +268,14 @@ 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