Deleted Added
full compact
termcap.c (8756) termcap.c (8770)
1/*
2 * Copyright (c) 1994, Paul Richards.
3 *
4 * All rights reserved.
5 *
6 * This software may be used, modified, copied, distributed, and sold, in both
7 * source and binary form provided that the above copyright and these terms
8 * are retained, verbatim, as the first lines of this file. Under no

--- 18 unchanged lines hidden (view full) ---

27set_termcap(void)
28{
29 char *term;
30 int stat;
31
32 OnVTY = OnSerial = FALSE;
33 if (getpid() != 1)
34 DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
1/*
2 * Copyright (c) 1994, Paul Richards.
3 *
4 * All rights reserved.
5 *
6 * This software may be used, modified, copied, distributed, and sold, in both
7 * source and binary form provided that the above copyright and these terms
8 * are retained, verbatim, as the first lines of this file. Under no

--- 18 unchanged lines hidden (view full) ---

27set_termcap(void)
28{
29 char *term;
30 int stat;
31
32 OnVTY = OnSerial = FALSE;
33 if (getpid() != 1)
34 DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
35 else
35 else {
36 int i, on;
37
38 DebugFD = open("/dev/ttyv1", O_WRONLY);
39 on = 1;
40 i = ioctl(DebugFD, TIOCCONS, (char *)&on);
41 msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno));
36 RunningAsInit = TRUE;
42 RunningAsInit = TRUE;
43 OnVTY = TRUE;
44 }
37 term = getenv("TERM");
38 stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
39 if (stat < 0) {
40 if (!term) {
41 if (setenv("TERM", "vt100", 1) < 0)
42 return -1;
43 if (setenv("TERMCAP", termcap_vt100, 1) < 0)
44 return -1;

--- 14 unchanged lines hidden (view full) ---

59 else {
60 if (!term) {
61 if (setenv("TERM", "cons25-m", 1) < 0)
62 return -1;
63 if (setenv("TERMCAP", termcap_cons25_m, 1) < 0)
64 return -1;
65 }
66 }
45 term = getenv("TERM");
46 stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
47 if (stat < 0) {
48 if (!term) {
49 if (setenv("TERM", "vt100", 1) < 0)
50 return -1;
51 if (setenv("TERMCAP", termcap_vt100, 1) < 0)
52 return -1;

--- 14 unchanged lines hidden (view full) ---

67 else {
68 if (!term) {
69 if (setenv("TERM", "cons25-m", 1) < 0)
70 return -1;
71 if (setenv("TERMCAP", termcap_cons25_m, 1) < 0)
72 return -1;
73 }
74 }
67 if (DebugFD == -1) {
68 int i;
69
70 DebugFD = open("/dev/ttyv1", O_WRONLY);
71 i = ioctl(DebugFD, TIOCCONS, (char *)NULL);
72 msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)", DebugFD, i, !i ? "success" : strerror(errno));
73 }
74 OnVTY = TRUE;
75 }
76 return 0;
77}
75 OnVTY = TRUE;
76 }
77 return 0;
78}