vt.patch revision 1124
474N/Adiff --git a/dix/main.c b/dix/main.c
474N/Aindex 9c3951a..86afa8c 100644
474N/A--- a/dix/main.c
474N/A+++ b/dix/main.c
474N/A@@ -79,6 +79,8 @@ Equipment Corporation.
474N/A #include <version-config.h>
474N/A #endif
474N/A
474N/A+#include <sys/stat.h>
474N/A+#include <stdio.h>
474N/A #include <X11/X.h>
474N/A #include <X11/Xos.h> /* for unistd.h */
474N/A #include <X11/Xproto.h>
474N/A@@ -122,6 +124,30 @@ extern void DtloginCloseDown(void);
474N/A
474N/A extern void Dispatch(void);
474N/A
474N/A+#if defined(sun)
474N/A+extern const char * GetAuthFilename(void);
474N/A+
474N/A+#define LOCK_PREFIX "/var/xauth/"
474N/A+
825N/A+/*
474N/A+ * Setup /var/xauth/$DISPLAY, which is a symlink to the
474N/A+ * actually auth file.
474N/A+ */
474N/A+static void
474N/A+SetupXauthFile(char *filename)
474N/A+{
474N/A+ struct stat buf;
825N/A+ char sym_authfile[40];
618N/A+
474N/A+ snprintf(sym_authfile, 40, LOCK_PREFIX "%s", display);
474N/A+
844N/A+ mkdir(LOCK_PREFIX, S_IRWXU);
844N/A+
474N/A+ remove(sym_authfile);
1273N/A+ symlink(filename, sym_authfile);
474N/A+}
474N/A+#endif
474N/A+
474N/A #ifdef XQUARTZ
474N/A #include <pthread.h>
844N/A
844N/A@@ -138,6 +164,9 @@ int main(int argc, char *argv[], char *envp[])
474N/A {
474N/A int i;
474N/A HWEventQueueType alwaysCheckForInput[2];
474N/A+#if defined(sun)
474N/A+ char *xauthfile = NULL;
474N/A+#endif
474N/A
474N/A display = "0";
474N/A
474N/A@@ -153,6 +182,12 @@ int main(int argc, char *argv[], char *envp[])
474N/A
474N/A ProcessCommandLine(argc, argv);
474N/A
474N/A+#if defined(sun)
474N/A+ xauthfile = GetAuthFilename();
474N/A+ if (xauthfile)
474N/A+ SetupXauthFile(xauthfile);
474N/A+#endif
474N/A+
474N/A alwaysCheckForInput[0] = 0;
474N/A alwaysCheckForInput[1] = 1;
474N/A while(1)
825N/Adiff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
825N/Aindex 281a6df..42e20ac 100644
825N/A--- a/hw/xfree86/os-support/solaris/sun_init.c
474N/A+++ b/hw/xfree86/os-support/solaris/sun_init.c
474N/A@@ -45,6 +45,9 @@
474N/A #define CONSOLE_VTNO 1
474N/A #define SOL_CONSOLE_DEV "/dev/console"
474N/A
474N/A+/* For use of VT_SETDISPLOGIN in dtlogin.c */
474N/A+extern int xf86ConsoleFd;
474N/A+
474N/A static Bool KeepTty = FALSE;
474N/A static Bool Protect0 = FALSE;
474N/A static Bool UseConsole = FALSE;
474N/A@@ -234,6 +237,8 @@ OPENCONSOLE:
474N/A
474N/A if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
474N/A xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
474N/A+
474N/A+ xf86ConsoleFd = xf86Info.consoleFd;
474N/A }
474N/A #endif
474N/A
474N/A