summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/termcap.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-05-18 15:29:47 +0000
committerjkh <jkh@FreeBSD.org>1995-05-18 15:29:47 +0000
commit05d53ab3a72fad10e4cd054385a989463c149d09 (patch)
treeddee1673e860ccbd6ed71f546ee602b5cdd073ff /usr.sbin/sysinstall/termcap.c
parenta2aa8e6d938599429cc618b57d5f766d09743aa9 (diff)
downloadFreeBSD-src-05d53ab3a72fad10e4cd054385a989463c149d09.zip
FreeBSD-src-05d53ab3a72fad10e4cd054385a989463c149d09.tar.gz
1. Use 8x16 fonts.
2. Don't use russian screenmap - apparently not necessary with right font. 3. Dequote bogusly quoted font name in english language setting. 4. Use setterm() and hack around an undesirable side-effect (cbreak is unset). 5. be smarter about setting OnVTY, and use it in cases where it makes sense. Submitted by: Nickolay N. Dudorov <nnd@gw.itfs.nsk.su>
Diffstat (limited to 'usr.sbin/sysinstall/termcap.c')
-rw-r--r--usr.sbin/sysinstall/termcap.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c
index 86e758a..2cd8158 100644
--- a/usr.sbin/sysinstall/termcap.c
+++ b/usr.sbin/sysinstall/termcap.c
@@ -26,35 +26,44 @@ int
set_termcap(void)
{
char *term;
+ int stat;
OnVTY = OnSerial = FALSE;
+ if (getpid() != 1)
+ DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
term = getenv("TERM");
- if (term == NULL) {
- if (ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay) < 0) {
+ stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
+ if (stat < 0) {
+ if (!term) {
if (setenv("TERM", "vt100", 1) < 0)
return -1;
if (setenv("TERMCAP", termcap_vt100, 1) < 0)
return -1;
- DebugFD = dup(1);
- OnSerial = TRUE;
- } else if (ColorDisplay) {
- if (setenv("TERM", "cons25", 1) < 0)
- return -1;
- if (setenv("TERMCAP", termcap_cons25, 1) < 0)
- return -1;
- DebugFD = open("/dev/ttyv1", O_WRONLY);
- OnVTY = TRUE;
- } else {
- if (setenv("TERM", "cons25-m", 1) < 0)
- return -1;
- if (setenv("TERMCAP", termcap_cons25_m, 1) < 0)
- return -1;
- DebugFD = open("/dev/ttyv1", O_WRONLY);
- OnVTY = TRUE;
}
+ if (DebugFD == -1)
+ DebugFD = dup(1);
+ OnSerial = TRUE;
}
else {
- DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ if (ColorDisplay) {
+ if (!term) {
+ if (setenv("TERM", "cons25", 1) < 0)
+ return -1;
+ if (setenv("TERMCAP", termcap_cons25, 1) < 0)
+ return -1;
+ }
+ }
+ else {
+ if (!term) {
+ if (setenv("TERM", "cons25-m", 1) < 0)
+ return -1;
+ if (setenv("TERMCAP", termcap_cons25_m, 1) < 0)
+ return -1;
+ }
+ }
+ if (DebugFD == -1)
+ DebugFD = open("/dev/ttyv1", O_WRONLY);
+ OnVTY = TRUE;
}
return 0;
}
OpenPOWER on IntegriCloud