vt.patch revision 778
766N/Adiff -urp -x '*~' -x '*.orig' dix/main.c dix/main.c
766N/A--- dix/main.c 2009-07-08 01:48:57.000000000 +0800
778N/A+++ dix/main.c 2009-09-08 16:29:20.327992000 +0800
766N/A@@ -79,6 +79,8 @@ Equipment Corporation.
766N/A #include <dix-config.h>
766N/A #endif
766N/A
766N/A+#include <sys/stat.h>
766N/A+#include <stdio.h>
766N/A #include <X11/X.h>
766N/A #include <X11/Xos.h> /* for unistd.h */
766N/A #include <X11/Xproto.h>
766N/A@@ -233,6 +235,30 @@ static int indexForScanlinePad[ 65 ] = {
766N/A #define MIN(a,b) (((a) < (b)) ? (a) : (b))
766N/A #endif
766N/A
766N/A+#if defined(sun)
766N/A+extern const char * GetAuthFilename(void);
766N/A+
766N/A+#define LOCK_PREFIX "/var/xauth/"
766N/A+
766N/A+/*
766N/A+ * Setup /var/xauth/$DISPLAY, which is a symlink to the
766N/A+ * actually auth file.
766N/A+ */
766N/A+static void
766N/A+SetupXauthFile(char *filename)
766N/A+{
766N/A+ struct stat buf;
766N/A+ char sym_authfile[40];
766N/A+
766N/A+ snprintf(sym_authfile, 40, LOCK_PREFIX "%s", display);
766N/A+
766N/A+ mkdir(LOCK_PREFIX, S_IRWXU);
766N/A+
766N/A+ remove(sym_authfile);
766N/A+ symlink(filename, sym_authfile);
766N/A+}
766N/A+#endif
766N/A+
766N/A #ifdef XQUARTZ
766N/A #include <pthread.h>
766N/A
766N/A@@ -247,6 +273,9 @@ int main(int argc, char *argv[], char *e
766N/A {
766N/A int i;
766N/A HWEventQueueType alwaysCheckForInput[2];
766N/A+#if defined(sun)
766N/A+ char *xauthfile = NULL;
766N/A+#endif
766N/A
766N/A display = "0";
766N/A
766N/A@@ -260,6 +289,12 @@ int main(int argc, char *argv[], char *e
766N/A
766N/A ProcessCommandLine(argc, argv);
766N/A
766N/A+#if defined(sun)
766N/A+ xauthfile = GetAuthFilename();
766N/A+ if (xauthfile)
766N/A+ SetupXauthFile(xauthfile);
766N/A+#endif
766N/A+
766N/A alwaysCheckForInput[0] = 0;
766N/A alwaysCheckForInput[1] = 1;
766N/A while(1)
766N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86Events.c hw/xfree86/common/xf86Events.c
766N/A--- hw/xfree86/common/xf86Events.c 2009-07-08 01:48:58.000000000 +0800
778N/A+++ hw/xfree86/common/xf86Events.c 2009-09-08 16:29:20.326923000 +0800
778N/A@@ -205,16 +205,31 @@ xf86ProcessActionEvent(ActionEvent actio
766N/A if (!xf86Info.dontZoom)
766N/A xf86ZoomViewport(xf86Info.currentScreen, -1);
766N/A break;
766N/A-#if !defined(__SOL8__) && \
766N/A- (!defined(sun) || defined(__i386__)) && defined(VT_ACTIVATE)
766N/A case ACTION_SWITCHSCREEN:
766N/A if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) {
766N/A int vtno = *((int *) arg);
766N/A #if defined(__SCO__) || defined(__UNIXWARE__)
766N/A vtno--;
766N/A #endif
766N/A+
766N/A+#if defined(sun)
778N/A+ if (vtno == xf86Info.vtno) {
766N/A+ break;
778N/A+ } else {
778N/A+ struct vt_stat state;
778N/A+ if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0)
778N/A+ break;
778N/A+
778N/A+ if ((state.v_state & (1 << vtno)) == 0)
778N/A+ break;
778N/A+ }
766N/A+
766N/A+ xf86Info.vtRequestsPending = TRUE;
766N/A+ xf86Info.vtPendingNum = vtno;
766N/A+#else
766N/A if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0)
766N/A ErrorF("Failed to switch consoles (%s)\n", strerror(errno));
766N/A+#endif
766N/A }
766N/A break;
766N/A case ACTION_SWITCHSCREEN_NEXT:
778N/A@@ -239,7 +254,7 @@ xf86ProcessActionEvent(ActionEvent actio
766N/A ErrorF("Failed to switch consoles (%s)\n", strerror(errno));
766N/A }
766N/A break;
766N/A-#endif
766N/A+
766N/A default:
766N/A break;
766N/A }
766N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86Globals.c hw/xfree86/common/xf86Globals.c
766N/A--- hw/xfree86/common/xf86Globals.c 2009-07-08 01:48:58.000000000 +0800
778N/A+++ hw/xfree86/common/xf86Globals.c 2009-09-08 16:29:20.327526000 +0800
766N/A@@ -104,6 +104,9 @@ xf86InfoRec xf86Info = {
766N/A .ddxSpecialKeys = SKWhenNeeded,
766N/A .lastEventTime = -1,
766N/A .vtRequestsPending = FALSE,
766N/A+#if defined(sun)
766N/A+ .vtPendingNum = -1,
766N/A+#endif
766N/A .dontVTSwitch = FALSE,
766N/A .dontZap = FALSE,
766N/A .dontZoom = FALSE,
766N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86Privstr.h hw/xfree86/common/xf86Privstr.h
766N/A--- hw/xfree86/common/xf86Privstr.h 2009-07-08 01:48:58.000000000 +0800
778N/A+++ hw/xfree86/common/xf86Privstr.h 2009-09-08 16:29:20.327232000 +0800
766N/A@@ -70,6 +70,11 @@ typedef struct {
766N/A /* event handler part */
766N/A int lastEventTime;
766N/A Bool vtRequestsPending;
766N/A+
766N/A+#if defined(sun)
766N/A+ int vtPendingNum;
766N/A+#endif
766N/A+
766N/A Bool dontVTSwitch;
766N/A Bool dontZap;
766N/A Bool dontZoom;
766N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/os-support/solaris/Makefile.am hw/xfree86/os-support/solaris/Makefile.am
778N/A--- hw/xfree86/os-support/solaris/Makefile.am 2009-09-08 16:29:16.886013000 +0800
778N/A+++ hw/xfree86/os-support/solaris/Makefile.am 2009-09-08 16:29:20.326026000 +0800
766N/A@@ -1,9 +1,3 @@
766N/A-if SOLARIS_USL_CONSOLE
766N/A-VTSW_SRC = $(srcdir)/../shared/VTsw_usl.c
766N/A-else
766N/A-VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c
766N/A-endif
766N/A-
766N/A if AGP
766N/A AGP_SRC = sun_agp.c
766N/A else
766N/A@@ -18,13 +12,13 @@ solaris-@SOLARIS_INOUT_ARCH@.il: solaris
766N/A
766N/A noinst_LTLIBRARIES = libsolaris.la
766N/A libsolaris_la_SOURCES = sun_init.c \
766N/A- sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c \
766N/A+ sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c sun_VTsw.c\
766N/A $(srcdir)/../shared/kmod_noop.c \
766N/A $(srcdir)/../shared/posix_tty.c \
766N/A $(srcdir)/../shared/sigio.c \
766N/A $(srcdir)/../shared/stdResource.c \
766N/A- $(srcdir)/../shared/vidmem.c \
766N/A- $(VTSW_SRC)
766N/A+ $(srcdir)/../shared/vidmem.c
766N/A+
766N/A nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC)
766N/A
766N/A sdk_HEADERS =
766N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/os-support/solaris/sun_init.c hw/xfree86/os-support/solaris/sun_init.c
766N/A--- hw/xfree86/os-support/solaris/sun_init.c 2008-12-16 03:45:40.000000000 +0800
778N/A+++ hw/xfree86/os-support/solaris/sun_init.c 2009-09-08 16:29:20.325732000 +0800
778N/A@@ -33,18 +33,25 @@
766N/A # include <sys/kd.h>
766N/A #endif
766N/A
766N/A+/* For use of VT_SETDISPLOGIN in dtlogin.c */
766N/A+extern int xf86ConsoleFd;
766N/A+
766N/A static Bool KeepTty = FALSE;
766N/A static Bool Protect0 = FALSE;
766N/A #ifdef HAS_USL_VTS
766N/A static int VTnum = -1;
766N/A static int xf86StartVT = -1;
778N/A+static int vtEnabled = 0;
778N/A+extern void xf86VTAcquire(int);
778N/A+extern void xf86VTRelease(int);
778N/A #endif
778N/A
766N/A-#if defined(__SOL8__) || (!defined(__i386__) && !defined(__i386))
766N/A-static char fb_dev[PATH_MAX] = "/dev/fb";
778N/A-#else
766N/A-static char fb_dev[PATH_MAX] = "/dev/console";
778N/A-#endif
778N/A+/* Device to open as xf86Info.consoleFd */
778N/A+static char console_dev[PATH_MAX] = "/dev/fb";
778N/A+
778N/A+/* Set by -dev argument on CLI
778N/A+ Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
778N/A+_X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
766N/A
766N/A void
778N/A xf86OpenConsole(void)
778N/A@@ -93,86 +100,105 @@ xf86OpenConsole(void)
766N/A /*
766N/A * Setup the virtual terminal manager
766N/A */
766N/A- if (VTnum != -1)
766N/A+ if ((fd = open("/dev/vt/0", O_RDWR, 0)) == -1)
766N/A {
766N/A- xf86Info.vtno = VTnum;
766N/A- from = X_CMDLINE;
766N/A+ xf86ErrorF("xf86OpenConsole: Cannot open /dev/vt/0 (%s)\n",
766N/A+ strerror(errno));
766N/A+ vtEnabled = 0;
766N/A }
766N/A else
766N/A {
766N/A- if ((fd = open("/dev/vt00",O_RDWR,0)) < 0)
766N/A- FatalError("xf86OpenConsole: Cannot open /dev/vt00 (%s)\n",
766N/A- strerror(errno));
766N/A+ if (ioctl(fd, VT_ENABLED, &vtEnabled) < 0)
766N/A+ {
766N/A+ xf86ErrorF("xf86OpenConsole: VT_ENABLED failed (%s)\n",
766N/A+ strerror(errno));
766N/A+ vtEnabled = 0;
766N/A+ }
766N/A+ }
766N/A
766N/A+ if (vtEnabled == 0)
766N/A+ {
766N/A+ /* VT not enabled - kernel too old or Sparc platforms
766N/A+ without visual_io support */
766N/A+ xf86Msg(from, "VT infrastructure is not available\n");
766N/A+
766N/A+ xf86StartVT = 0;
766N/A+ xf86Info.vtno = 0;
778N/A+ strlcpy(console_dev, xf86SolarisFbDev, sizeof(console_dev));
766N/A+ }
766N/A+ else
766N/A+ {
766N/A if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
766N/A FatalError("xf86OpenConsole: Cannot determine current VT\n");
766N/A
766N/A xf86StartVT = vtinfo.v_active;
766N/A
766N/A- /*
766N/A- * There is a SEVERE problem with x86's VT's. The VT_OPENQRY
766N/A- * ioctl() will panic the entire system if all 8 (7 VT's+Console)
766N/A- * terminals are used. The only other way I've found to determine
766N/A- * if there is a free VT is to try activating all the the available
766N/A- * VT's and see if they all succeed - if they do, there there is no
766N/A- * free VT, and the Xserver cannot continue without panic'ing the
766N/A- * system. (It's ugly, but it seems to work.) Note there is a
766N/A- * possible race condition here.
766N/A- *
766N/A- * David Holland 2/23/94
766N/A- */
766N/A-
766N/A- FreeVTslot = 0;
766N/A- for (i = 7; (i >= 0) && !FreeVTslot; i--)
766N/A- if (ioctl(fd, VT_ACTIVATE, i) != 0)
766N/A- FreeVTslot = 1;
766N/A-
766N/A- if (!FreeVTslot ||
766N/A- (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
766N/A- (xf86Info.vtno == -1))
766N/A- FatalError("xf86OpenConsole: Cannot find a free VT\n");
766N/A+ if (VTnum != -1)
766N/A+ {
766N/A+ xf86Info.vtno = VTnum;
766N/A+ from = X_CMDLINE;
766N/A+ }
766N/A+ else
766N/A+ {
766N/A+ if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
766N/A+ (xf86Info.vtno == -1))
766N/A+ {
766N/A+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
766N/A+ }
766N/A+ }
766N/A
766N/A- close(fd);
766N/A+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
778N/A+ snprintf(console_dev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
766N/A }
766N/A
766N/A- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
766N/A-
766N/A- sprintf(fb_dev, "/dev/vt%02d", xf86Info.vtno); /* Solaris 2.1 x86 */
766N/A+ if (fd != -1)
766N/A+ {
766N/A+ close(fd);
766N/A+ }
766N/A
766N/A #endif /* HAS_USL_VTS */
766N/A
778N/A if (!KeepTty)
778N/A setpgrp();
778N/A
778N/A- if (((xf86Info.consoleFd = open(fb_dev, O_RDWR | O_NDELAY, 0)) < 0))
778N/A+ if (((xf86Info.consoleFd = open(console_dev, O_RDWR | O_NDELAY, 0)) < 0))
778N/A FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
778N/A- fb_dev, strerror(errno));
778N/A+ console_dev, strerror(errno));
778N/A
778N/A #ifdef HAS_USL_VTS
778N/A
766N/A /* Change ownership of the vt */
778N/A- chown(fb_dev, getuid(), getgid());
778N/A+ chown(console_dev, getuid(), getgid());
766N/A
766N/A- /*
766N/A- * Now get the VT
766N/A- */
766N/A- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
766N/A- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
766N/A+ if (vtEnabled)
766N/A+ {
766N/A+ /*
766N/A+ * Now get the VT
766N/A+ */
766N/A+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
766N/A+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
766N/A
766N/A- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
766N/A- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
778N/A+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
778N/A+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
766N/A
766N/A- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
766N/A- FatalError("xf86OpenConsole: VT_GETMODE failed\n");
778N/A+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
778N/A+ FatalError("xf86OpenConsole: VT_GETMODE failed\n");
766N/A
766N/A- signal(SIGUSR1, xf86VTRequest);
778N/A+ OsSignal(SIGUSR1, xf86VTAcquire);
778N/A+ OsSignal(SIGUSR2, xf86VTRelease);
766N/A
766N/A- VT.mode = VT_PROCESS;
766N/A- VT.relsig = SIGUSR1;
766N/A- VT.acqsig = SIGUSR1;
778N/A+ VT.mode = VT_PROCESS;
778N/A+ VT.acqsig = SIGUSR1;
778N/A+ VT.relsig = SIGUSR2;
766N/A
766N/A- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
766N/A- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
778N/A+ if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
778N/A+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
778N/A+
778N/A+ if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
778N/A+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISINFO failed\n");
778N/A+
766N/A+ xf86ConsoleFd = xf86Info.consoleFd;
766N/A+ }
766N/A #endif
766N/A
766N/A #ifdef KDSETMODE
778N/A@@ -180,30 +206,33 @@ xf86OpenConsole(void)
778N/A if (i < 0) {
778N/A xf86Msg(X_WARNING,
778N/A "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n",
778N/A- fb_dev, strerror(errno));
778N/A+ console_dev, strerror(errno));
778N/A }
778N/A #endif
778N/A }
766N/A else /* serverGeneration != 1 */
766N/A {
766N/A #ifdef HAS_USL_VTS
766N/A- /*
766N/A- * Now re-get the VT
766N/A- */
766N/A- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
766N/A- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
766N/A+ if (vtEnabled)
766N/A+ {
766N/A+ /*
766N/A+ * Now re-get the VT
766N/A+ */
766N/A+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
766N/A+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
766N/A
766N/A- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
766N/A- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
766N/A+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
766N/A+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
766N/A
766N/A- /*
766N/A- * If the server doesn't have the VT when the reset occurs,
766N/A- * this is to make sure we don't continue until the activate
766N/A- * signal is received.
766N/A- */
766N/A- if (!xf86Screens[0]->vtSema)
766N/A- sleep(5);
766N/A+ /*
766N/A+ * If the server doesn't have the VT when the reset occurs,
766N/A+ * this is to make sure we don't continue until the activate
766N/A+ * signal is received.
766N/A+ */
766N/A+ if (!xf86Screens[0]->vtSema)
766N/A+ sleep(5);
766N/A
766N/A+ }
766N/A #endif /* HAS_USL_VTS */
766N/A
766N/A }
778N/A@@ -268,28 +297,17 @@ xf86CloseConsole(void)
766N/A
766N/A #ifdef HAS_USL_VTS
766N/A
766N/A- /*
766N/A- * Solaris 2.1 x86 doesn't seem to "switch" back to the console when the VT
766N/A- * is relinquished and its mode is reset to auto. Also, Solaris 2.1 seems
766N/A- * to associate vt00 with the console so I've opened the "console" back up
766N/A- * and made it the active vt again in text mode and then closed it. There
766N/A- * must be a better hack for this but I'm not aware of one at this time.
766N/A- *
766N/A- * Doug Anson 11/6/93
766N/A- * danson@lgc.com
766N/A- *
766N/A- * Fixed - 12/5/93 - David Holland - davidh@dorite.use.com
766N/A- * Did the whole thing similarly to the way linux does it
766N/A- */
766N/A-
766N/A- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
766N/A+ if (vtEnabled)
766N/A {
766N/A- VT.mode = VT_AUTO; /* Set default vt handling */
766N/A- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
766N/A- }
766N/A+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
766N/A+ {
766N/A+ VT.mode = VT_AUTO; /* Set default vt handling */
766N/A+ ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
766N/A+ }
766N/A
766N/A- /* Activate the VT that X was started on */
766N/A- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
766N/A+ /* Activate the VT that X was started on */
766N/A+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
766N/A+ }
766N/A
766N/A #endif /* HAS_USL_VTS */
766N/A
778N/A@@ -323,7 +341,7 @@ xf86ProcessArgument(int argc, char **arg
766N/A
766N/A if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
766N/A {
766N/A- if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
766N/A+ if (sscanf(argv[i], "vt%d", &VTnum) == 0)
766N/A {
766N/A UseMsg();
766N/A VTnum = -1;
778N/A@@ -337,8 +355,8 @@ xf86ProcessArgument(int argc, char **arg
778N/A
778N/A if ((i + 1) < argc) {
778N/A if (!strcmp(argv[i], "-dev")) {
778N/A- strncpy(fb_dev, argv[i+1], PATH_MAX);
778N/A- fb_dev[PATH_MAX - 1] = '\0';
778N/A+ strncpy(xf86SolarisFbDev, argv[i+1], PATH_MAX);
778N/A+ xf86SolarisFbDev[PATH_MAX - 1] = '\0';
778N/A return 2;
778N/A }
778N/A }
778N/A@@ -349,7 +367,7 @@ xf86ProcessArgument(int argc, char **arg
766N/A void xf86UseMsg()
766N/A {
766N/A #ifdef HAS_USL_VTS
766N/A- ErrorF("vtXX Use the specified VT number\n");
766N/A+ ErrorF("vtX Use the specified VT number\n");
766N/A #endif
766N/A ErrorF("-dev <fb> Framebuffer device\n");
766N/A ErrorF("-keeptty Don't detach controlling tty\n");
766N/Adiff -urp -x '*~' -x '*.orig' hw/xfree86/os-support/xf86_OSlib.h hw/xfree86/os-support/xf86_OSlib.h
766N/A--- hw/xfree86/os-support/xf86_OSlib.h 2008-11-15 05:27:05.000000000 +0800
778N/A+++ hw/xfree86/os-support/xf86_OSlib.h 2009-09-08 16:29:20.326443000 +0800
766N/A@@ -140,9 +140,8 @@
766N/A # include <sys/mmap.h> /* MMAP driver header */
766N/A # endif
766N/A
766N/A-# if !defined(sun) || (!defined(sparc) && !defined(__SOL8__))
766N/A # define HAS_USL_VTS
766N/A-# endif
766N/A+
766N/A # if !defined(sun)
766N/A # include <sys/emap.h>
766N/A # endif
766N/A@@ -155,10 +154,14 @@
766N/A # define LED_NUM NLKED
766N/A # define LED_SCR SLKED
766N/A # elif defined(HAS_USL_VTS)
766N/A-# include <sys/at_ansi.h>
766N/A+# if !defined(sun)
766N/A+# include <sys/at_ansi.h>
766N/A+# endif
766N/A # include <sys/kd.h>
766N/A # include <sys/vt.h>
766N/A-# elif defined(sun)
766N/A+# endif
766N/A+
766N/A+# if defined(sun)
766N/A # include <sys/fbio.h>
766N/A # include <sys/kbd.h>
766N/A # include <sys/kbio.h>