Date: Sun, 21 Dec 2008 21:54:01 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186383 - head/sys/kern Message-ID: <200812212154.mBLLs1Vx043239@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sun Dec 21 21:54:01 2008 New Revision: 186383 URL: http://svn.freebsd.org/changeset/base/186383 Log: 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> Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Sun Dec 21 21:16:57 2008 (r186382) +++ head/sys/kern/subr_prf.c Sun Dec 21 21:54:01 2008 (r186383) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812212154.mBLLs1Vx043239>