Minor update for handling TERM with serial consoles.
authorErik Andersen <andersen@codepoet.org>
Mon, 21 Feb 2000 19:25:12 +0000 (19:25 -0000)
committerErik Andersen <andersen@codepoet.org>
Mon, 21 Feb 2000 19:25:12 +0000 (19:25 -0000)
 -Erik

init.c
init/init.c

diff --git a/init.c b/init.c
index a3e165ecce3bf4317f39509a23f61381c16d724a..4a19822ae2d79ae32bf71df89429d96221c8e6d9 100644 (file)
--- a/init.c
+++ b/init.c
@@ -314,8 +314,10 @@ static void console_init()
                if (ioctl(0, TIOCGSERIAL, &sr) == 0) {
                        log = NULL;
                        secondConsole = NULL;
-                       /* Force the TERM setting to vt102 for serial console */
-                       snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
+                       /* Force the TERM setting to vt102 for serial console --
+                        * iff TERM is set to linux (the default) */
+                       if (strcmp( termType, "TERM=linux" ) == 0)
+                               snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
                        message(LOG | CONSOLE,
                                        "serial console detected.  Disabling virtual terminals.\r\n");
                }
index a3e165ecce3bf4317f39509a23f61381c16d724a..4a19822ae2d79ae32bf71df89429d96221c8e6d9 100644 (file)
@@ -314,8 +314,10 @@ static void console_init()
                if (ioctl(0, TIOCGSERIAL, &sr) == 0) {
                        log = NULL;
                        secondConsole = NULL;
-                       /* Force the TERM setting to vt102 for serial console */
-                       snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
+                       /* Force the TERM setting to vt102 for serial console --
+                        * iff TERM is set to linux (the default) */
+                       if (strcmp( termType, "TERM=linux" ) == 0)
+                               snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
                        message(LOG | CONSOLE,
                                        "serial console detected.  Disabling virtual terminals.\r\n");
                }