From c8cce3f302ce47db42e65ab2078f7ca9027af968 Mon Sep 17 00:00:00 2001 From: Isaac Dunham Date: Tue, 28 Jan 2014 17:46:14 -0600 Subject: init: don't use VT_OPENQRY. The original codepath checks if there is a VT available, and if there isn't sets TERM to vt102 (unless TERM is set to something other than "linux"). Otherwise, TERM is set to "linux" if it is not already set. However, we can rely on getty/... to set TERM if "linux" is not suitable. This has the benefit of dropping a slightly messy section. --- toys/pending/init.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'toys') diff --git a/toys/pending/init.c b/toys/pending/init.c index 91110fa6..8199e748 100644 --- a/toys/pending/init.c +++ b/toys/pending/init.c @@ -17,7 +17,6 @@ config INIT */ #include "toys.h" -#include #include struct action_list_seed { @@ -60,14 +59,7 @@ static void initialize_console(void) } } - p = getenv("TERM"); -#ifdef VT_OPENQRY - int terminal_no; - if (ioctl(0, VT_OPENQRY, &terminal_no)) { - if (!p || !strcmp(p,"linux")) putenv("TERM=vt102"); - } else -#endif - if (!p) putenv("TERM=linux"); + if (!getenv("TERM")) putenv("TERM=linux"); } static void set_sane_term(void) -- cgit v1.2.3