diff options
author | Isaac Dunham <ibid.ag@gmail.com> | 2014-01-28 17:46:14 -0600 |
---|---|---|
committer | Isaac Dunham <ibid.ag@gmail.com> | 2014-01-28 17:46:14 -0600 |
commit | c8cce3f302ce47db42e65ab2078f7ca9027af968 (patch) | |
tree | d025e3e7cb09a635dcc87050e291dce429980b60 /toys/pending/init.c | |
parent | 714a0db2ade17f61f09816f0f7067f14e049e645 (diff) | |
download | toybox-c8cce3f302ce47db42e65ab2078f7ca9027af968.tar.gz |
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.
Diffstat (limited to 'toys/pending/init.c')
-rw-r--r-- | toys/pending/init.c | 10 |
1 files changed, 1 insertions, 9 deletions
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 <linux/vt.h> #include <sys/reboot.h> 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) |