summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/termcap.c
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1995-06-11 19:33:05 +0000
committerrgrimes <rgrimes@FreeBSD.org>1995-06-11 19:33:05 +0000
commit1b1ee5553889e207087539ddafa5dfd4e28bd585 (patch)
treeba998dfb4fcad03e00a5cbf58e2a0ad648bab6e6 /usr.sbin/sade/termcap.c
parentb1a97daa1e06ab0de3071f979965878fd056292b (diff)
downloadFreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.zip
FreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.tar.gz
Merge RELENG_2_0_5 into HEAD
Diffstat (limited to 'usr.sbin/sade/termcap.c')
-rw-r--r--usr.sbin/sade/termcap.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/usr.sbin/sade/termcap.c b/usr.sbin/sade/termcap.c
index 384e532..3ab2088 100644
--- a/usr.sbin/sade/termcap.c
+++ b/usr.sbin/sade/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;
}
OpenPOWER on IntegriCloud