aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_terminal.c
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2019-09-26 07:19:26 +0000
committerToomas Soome <tsoome@FreeBSD.org>2019-09-26 07:19:26 +0000
commit11fc80a09824d8e3acce9775aff1e3b7c8a1f305 (patch)
tree95ff4f0225f20aa29a541e965782a822b1bef78f /sys/kern/subr_terminal.c
parent29f7096df916cebe29fc5459114254da5fbbafce (diff)
kernel terminal should initialize fg and bg variables before calling TUNABLE_INT_FETCH
We have two ways to check if kenv variable exists - either we check return value from TUNABLE_INT_FETCH, or we pre-initialize the variable and check if this value did change. In terminal_init() it is more convinient to use pre-initialized variables. Problem was revealed by older loader.efi, which did not set teken.* variables. Reported by: tuexen
Notes
Notes: svn path=/head/; revision=352740
Diffstat (limited to 'sys/kern/subr_terminal.c')
-rw-r--r--sys/kern/subr_terminal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/subr_terminal.c b/sys/kern/subr_terminal.c
index be52d0618dfc..4d7665cf3377 100644
--- a/sys/kern/subr_terminal.c
+++ b/sys/kern/subr_terminal.c
@@ -175,6 +175,7 @@ terminal_init(struct terminal *tm)
teken_init(&tm->tm_emulator, &terminal_drawmethods, tm);
+ fg = bg = -1;
TUNABLE_INT_FETCH("teken.fg_color", &fg);
TUNABLE_INT_FETCH("teken.bg_color", &bg);