summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvangyzen <vangyzen@FreeBSD.org>2015-10-02 14:21:07 +0000
committervangyzen <vangyzen@FreeBSD.org>2015-10-02 14:21:07 +0000
commit65381bf93d359744f5273394ccc73cf9fe5b55d8 (patch)
tree845abef8776d4eec5d50f733281b390a204bdbbe
parent2101014bc08a28397a999d962792673716d08097 (diff)
downloadFreeBSD-src-65381bf93d359744f5273394ccc73cf9fe5b55d8.zip
FreeBSD-src-65381bf93d359744f5273394ccc73cf9fe5b55d8.tar.gz
MFC r281785
Always send log(9) messages to the message buffer. It is truer to the semantics of logging for messages to *always* go to the message buffer, where they can eventually be collected and, in fact, be put into a log file. This restores the behavior prior to r70239, which seems to have changed it inadvertently. Submitted by: Eric Badger <eric@badgerio.us> Obtained from: Dell Inc.
-rw-r--r--share/man/man9/printf.93
-rw-r--r--sys/kern/subr_prf.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/share/man/man9/printf.9 b/share/man/man9/printf.9
index 571e7e6..9abb125 100644
--- a/share/man/man9/printf.9
+++ b/share/man/man9/printf.9
@@ -67,7 +67,8 @@ The
.Fn log
function sends the message to the kernel logging facility, using
the log level as indicated by
-.Fa pri .
+.Fa pri ,
+and to the console if no process is yet reading the log.
.Pp
Each of these related functions use the
.Fa fmt
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index ebc08e7..5698bd4 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -305,7 +305,7 @@ log(int level, const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
- (void)_vprintf(level, log_open ? TOLOG : TOCONS, fmt, ap);
+ (void)_vprintf(level, log_open ? TOLOG : TOCONS | TOLOG, fmt, ap);
va_end(ap);
msgbuftrigger = 1;
OpenPOWER on IntegriCloud