From owner-svn-src-all@FreeBSD.ORG Wed Dec 10 21:48:05 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CC9A106568E; Wed, 10 Dec 2008 21:48:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7944E8FC22; Wed, 10 Dec 2008 21:48:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBALm5IA044022; Wed, 10 Dec 2008 21:48:05 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBALm5Lt044021; Wed, 10 Dec 2008 21:48:05 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200812102148.mBALm5Lt044021@svn.freebsd.org> From: Ed Schouten Date: Wed, 10 Dec 2008 21:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185891 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 21:48:05 -0000 Author: ed Date: Wed Dec 10 21:48:05 2008 New Revision: 185891 URL: http://svn.freebsd.org/changeset/base/185891 Log: 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). Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Wed Dec 10 21:32:58 2008 (r185890) +++ head/sys/kern/subr_prf.c Wed Dec 10 21:48:05 2008 (r185891) @@ -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);