Mercurial > hg > toybox
changeset 1187:18cc63376e66 draft
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.
author | Isaac Dunham <ibid.ag@gmail.com> |
---|---|
date | Tue, 28 Jan 2014 17:46:14 -0600 |
parents | 8b62561ce52a |
children | cb62f7090473 |
files | toys/pending/init.c |
diffstat | 1 files changed, 1 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/pending/init.c Tue Jan 28 10:10:25 2014 -0600 +++ b/toys/pending/init.c Tue Jan 28 17:46:14 2014 -0600 @@ -17,7 +17,6 @@ */ #include "toys.h" -#include <linux/vt.h> #include <sys/reboot.h> struct action_list_seed { @@ -60,14 +59,7 @@ } } - 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)