1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-28 10:08:24 +00:00
freebsd-ports/japanese/kon2-16dot/files/patch-af
Norikatsu Shigemura 872f681f8a o Fix open /dev/vga problem on 5.x. [1]
o Fix build on 6-current.
o Bump PORTREVISION, accordingly.

PR:		ports/74881 [1]
Submitted by:	Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> [1]
2004-12-24 03:11:00 +00:00

69 lines
1.9 KiB
Plaintext

--- src/term.c.orig Sat Jan 25 00:03:58 1997
+++ src/term.c Sun Sep 19 05:01:34 2004
@@ -33,7 +33,13 @@
#include <termio.h>
#elif defined(__FreeBSD__)
#include <termios.h>
-#include <machine/console.h>
+#include <osreldate.h>
+#if __FreeBSD_version >= 410000
+# include <sys/consio.h>
+# include <sys/kbio.h>
+#else
+# include <machine/console.h>
+#endif
#define termio termios
#endif
#include <signal.h>
@@ -201,11 +207,14 @@
}
if (FD_ISSET(0, &readFds)) {
i = read(0, buff, BUFSIZ);
+#if defined(__FreeBSD__)
+ i = cons25tovt100(buff, i, BUFSIZ);
+#endif
if (i > 0) write(masterPty, buff, i);
PollCursor(TRUE);
}
if (FD_ISSET(sockFd, &readFds)) SocketInterface(sockFd);
- if (mInfo.has_mouse) {
+ if (mInfo.has_mouse && mouseFd > 0) {
if (FD_ISSET(mouseFd, &readFds) && con.active) {
i = read(mouseFd, buff, BUFSIZ);
if (i > 0) MouseGetPacket(buff, i);
@@ -449,11 +458,18 @@
PerrorExit("/dev/console");
}
#elif defined(__FreeBSD__)
+#if __FreeBSD_version >= 501100
+ cfd = open("/dev/ttyv0", O_WRONLY);
+ if (cfd < 0 && (cfd = open("/dev/ttyv0", O_RDONLY)) < 0) {
+ PerrorExit("/dev/ttyv0");
+ }
+#else
cfd = open("/dev/vga", O_WRONLY);
if (cfd < 0 && (cfd = open("/dev/vga", O_RDONLY)) < 0) {
PerrorExit("/dev/vga");
}
#endif
+#endif
ioctl(cfd, VT_ACTIVATE, orgVtNum);
close(cfd);
}
@@ -471,9 +487,15 @@
if (cfd < 0 && (cfd = open("/dev/console", O_RDONLY)) < 0)
fatal("can't open /dev/console");
#elif defined(__FreeBSD__)
+#if __FreeBSD_version >= 501100
+ cfd = open("/dev/ttyv0", O_WRONLY);
+ if (cfd < 0 && (cfd = open("/dev/ttyv0", O_RDONLY)) < 0)
+ fatal("can't open /dev/ttyv0");
+#else
cfd = open("/dev/vga", O_WRONLY);
if (cfd < 0 && (cfd = open("/dev/vga", O_RDONLY)) < 0)
fatal("can't open /dev/vga");
+#endif
#endif
ioctl(cfd, KDGETMODE, &mode);
if (mode == KD_TEXT) {