summaryrefslogtreecommitdiff
path: root/board/MAI/bios_emulator/scitech/src/v86bios/console.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-27 21:31:46 +0000
committerwdenk <wdenk>2003-06-27 21:31:46 +0000
commit8bde7f776c77b343aca29b8c7b58464d915ac245 (patch)
tree20f1fd99975215e7c658454a15cdb4ed4694e2d4 /board/MAI/bios_emulator/scitech/src/v86bios/console.c
parent993cad9364c6b87ae429d1ed1130d8153f6f027e (diff)
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'board/MAI/bios_emulator/scitech/src/v86bios/console.c')
-rw-r--r--board/MAI/bios_emulator/scitech/src/v86bios/console.c59
1 files changed, 25 insertions, 34 deletions
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/console.c b/board/MAI/bios_emulator/scitech/src/v86bios/console.c
index 46805155f8..5e9c924b64 100644
--- a/board/MAI/bios_emulator/scitech/src/v86bios/console.c
+++ b/board/MAI/bios_emulator/scitech/src/v86bios/console.c
@@ -36,43 +36,43 @@ open_console(void)
char VTname[11];
console Con = {-1,-1};
struct vt_stat vts;
-
+
if (NO_CONSOLE)
- return Con;
-
+ return Con;
+
if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
- return Con;
+ return Con;
if ((ioctl(fd, VT_OPENQRY, &VTno) < 0) || (VTno == -1)) {
- fprintf(stderr,"cannot get a vt\n");
- return Con;
+ fprintf(stderr,"cannot get a vt\n");
+ return Con;
}
-
+
close(fd);
sprintf(VTname,"/dev/tty%i",VTno);
-
+
if ((fd = open(VTname, O_RDWR|O_NDELAY, 0)) < 0) {
- fprintf(stderr,"cannot open console\n");
- return Con;
+ fprintf(stderr,"cannot open console\n");
+ return Con;
}
-
- if (ioctl(fd, VT_GETSTATE, &vts) == 0)
- Con.vt = vts.v_active;
+
+ if (ioctl(fd, VT_GETSTATE, &vts) == 0)
+ Con.vt = vts.v_active;
if (ioctl(fd, VT_ACTIVATE, VTno) != 0) {
- fprintf(stderr,"cannot activate console\n");
- close(fd);
- return Con;
+ fprintf(stderr,"cannot activate console\n");
+ close(fd);
+ return Con;
}
if (ioctl(fd, VT_WAITACTIVE, VTno) != 0) {
- fprintf(stderr,"wait for active console failed\n");
- close(fd);
- return Con;
+ fprintf(stderr,"wait for active console failed\n");
+ close(fd);
+ return Con;
}
#if 0
if (ioctl(fd, KDSETMODE, KD_GRAPHICS) < 0) {
- close(fd);
- return Con;
+ close(fd);
+ return Con;
}
#endif
Con.fd = fd;
@@ -83,22 +83,13 @@ void
close_console(console Con)
{
if (Con.fd == -1)
- return;
-
+ return;
+
#if 0
ioctl(Con.fd, KDSETMODE, KD_TEXT);
#endif
if (Con.vt >=0)
- ioctl(Con.fd, VT_ACTIVATE, Con.vt);
-
+ ioctl(Con.fd, VT_ACTIVATE, Con.vt);
+
close(Con.fd);
}
-
-
-
-
-
-
-
-
-