diff options
author | rgrimes <rgrimes@FreeBSD.org> | 1995-06-11 19:33:05 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 1995-06-11 19:33:05 +0000 |
commit | 1b1ee5553889e207087539ddafa5dfd4e28bd585 (patch) | |
tree | ba998dfb4fcad03e00a5cbf58e2a0ad648bab6e6 /release/sysinstall/termcap.c | |
parent | b1a97daa1e06ab0de3071f979965878fd056292b (diff) | |
download | FreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.zip FreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.tar.gz |
Merge RELENG_2_0_5 into HEAD
Diffstat (limited to 'release/sysinstall/termcap.c')
-rw-r--r-- | release/sysinstall/termcap.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/release/sysinstall/termcap.c b/release/sysinstall/termcap.c index 384e532..3ab2088 100644 --- a/release/sysinstall/termcap.c +++ b/release/sysinstall/termcap.c @@ -29,21 +29,16 @@ set_termcap(void) char *term; int stat; - OnVTY = OnSerial = FALSE; - if (getpid() != 1) - DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); - else { - int i, on; + OnVTY = RunningAsInit = FALSE; - DebugFD = open("/dev/ttyv1", O_WRONLY); - on = 1; - i = ioctl(DebugFD, TIOCCONS, (char *)&on); - msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno)); - RunningAsInit = TRUE; - OnVTY = TRUE; - } term = getenv("TERM"); stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay); + + if (getpid() != 1) + DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); + else + RunningAsInit = TRUE; + if (stat < 0) { if (!term) { if (setenv("TERM", "vt100", 1) < 0) @@ -53,9 +48,15 @@ set_termcap(void) } if (DebugFD == -1) DebugFD = dup(1); - OnSerial = TRUE; } else { + int i, on; + + DebugFD = open("/dev/ttyv1", O_WRONLY); + on = 1; + i = ioctl(DebugFD, TIOCCONS, (char *)&on); + msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno)); + OnVTY = TRUE; if (ColorDisplay) { if (!term) { if (setenv("TERM", "cons25", 1) < 0) @@ -72,7 +73,6 @@ set_termcap(void) return -1; } } - OnVTY = TRUE; } return 0; } |