summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_prf.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-06-18 20:12:42 +0000
committergreen <green@FreeBSD.org>2004-06-18 20:12:42 +0000
commite57eac4be2487a6e3b24c40052e828e9a5081d12 (patch)
tree0db18222c01cb64dbe302cc6a4890acddb68d653 /sys/kern/subr_prf.c
parent989cfda158c14543d5d526bba866a112500966fd (diff)
downloadFreeBSD-src-e57eac4be2487a6e3b24c40052e828e9a5081d12.zip
FreeBSD-src-e57eac4be2487a6e3b24c40052e828e9a5081d12.tar.gz
Add a sysctl/tunable, "kern.always_console_output", that lets you set
output to permanently (not ephemerally) go to the console. It is also sent to any other console specified by TIOCCONS as normal. While I'm here, document the kern.log_console_output sysctl.
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r--sys/kern/subr_prf.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 64e4eb1..9f4bedd 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -97,7 +97,12 @@ int msgbuftrigger;
static int log_console_output = 1;
TUNABLE_INT("kern.log_console_output", &log_console_output);
SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RW,
- &log_console_output, 0, "");
+ &log_console_output, 0, "Duplicate console output to the syslog.");
+
+static int always_console_output = 0;
+TUNABLE_INT("kern.always_console_output", &always_console_output);
+SYSCTL_INT(_kern, OID_AUTO, always_console_output, CTLFLAG_RW,
+ &always_console_output, 0, "Always output to console despite TIOCCONS.");
/*
* Warn that a system table is full.
@@ -345,8 +350,12 @@ putchar(int c, void *arg)
} else {
if ((flags & TOTTY) && tp != NULL)
tputchar(c, tp);
- if ((flags & TOCONS) && constty != NULL)
- msgbuf_addchar(&consmsgbuf, c);
+ if (flags & TOCONS) {
+ if (constty != NULL)
+ msgbuf_addchar(&consmsgbuf, c);
+ if (always_console_output && c != '\0')
+ cnputc(c);
+ }
}
if ((flags & TOLOG))
msglogchar(c, ap->pri);
OpenPOWER on IntegriCloud