open-src/xserver/xorg/vt.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Mon, 09 May 2011 14:58:28 -0700
changeset 1124 7bc7e624f965
parent 1088 1c99106ccbe0
child 1265 0b5cc5c013e4
permissions -rw-r--r--
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214] PSARC/2011/213 X Synchronization Extension version 3.1 PSARC/2011/214 Xorg server 1.10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
     1
diff --git a/dix/main.c b/dix/main.c
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
     2
index 9c3951a..86afa8c 100644
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
     3
--- a/dix/main.c
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
     4
+++ b/dix/main.c
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
     5
@@ -79,6 +79,8 @@ Equipment Corporation.
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 784
diff changeset
     6
 #include <version-config.h>
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
     7
 #endif
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
     8
 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
     9
+#include <sys/stat.h>
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    10
+#include <stdio.h>
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    11
 #include <X11/X.h>
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    12
 #include <X11/Xos.h>   /* for unistd.h  */
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    13
 #include <X11/Xproto.h>
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    14
@@ -122,6 +124,30 @@ extern void DtloginCloseDown(void);
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 784
diff changeset
    15
 
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    16
 extern void Dispatch(void);
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    17
 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    18
+#if defined(sun) 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    19
+extern const char * GetAuthFilename(void);
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    20
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    21
+#define LOCK_PREFIX	"/var/xauth/"
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    22
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    23
+/*
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    24
+ * Setup /var/xauth/$DISPLAY, which is a symlink to the
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    25
+ * actually auth file.
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    26
+ */
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    27
+static void
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    28
+SetupXauthFile(char *filename)
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    29
+{
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    30
+	struct stat buf;
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    31
+	char sym_authfile[40];
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    32
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    33
+	snprintf(sym_authfile, 40, LOCK_PREFIX "%s", display);
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    34
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    35
+	mkdir(LOCK_PREFIX, S_IRWXU);
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    36
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    37
+	remove(sym_authfile);
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    38
+	symlink(filename, sym_authfile);
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    39
+}
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    40
+#endif
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    41
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    42
 #ifdef XQUARTZ
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    43
 #include <pthread.h>
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    44
 
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    45
@@ -138,6 +164,9 @@ int main(int argc, char *argv[], char *envp[])
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    46
 {
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    47
     int		i;
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    48
     HWEventQueueType	alwaysCheckForInput[2];
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    49
+#if defined(sun) 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    50
+    char *xauthfile = NULL;
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    51
+#endif
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    52
 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    53
     display = "0";
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    54
 
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    55
@@ -153,6 +182,12 @@ int main(int argc, char *argv[], char *envp[])
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    56
 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    57
     ProcessCommandLine(argc, argv);
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    58
 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    59
+#if defined(sun)
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    60
+    xauthfile = GetAuthFilename();
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    61
+    if (xauthfile)
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    62
+	SetupXauthFile(xauthfile);
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    63
+#endif
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    64
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    65
     alwaysCheckForInput[0] = 0;
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    66
     alwaysCheckForInput[1] = 1;
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    67
     while(1)
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    68
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    69
index 281a6df..42e20ac 100644
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    70
--- a/hw/xfree86/os-support/solaris/sun_init.c
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    71
+++ b/hw/xfree86/os-support/solaris/sun_init.c
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 913
diff changeset
    72
@@ -45,6 +45,9 @@
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 913
diff changeset
    73
 #define	CONSOLE_VTNO	1
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 913
diff changeset
    74
 #define	SOL_CONSOLE_DEV	"/dev/console"
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    75
 
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    76
+/* For use of VT_SETDISPLOGIN in dtlogin.c */
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    77
+extern int xf86ConsoleFd;
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    78
+
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    79
 static Bool KeepTty = FALSE;
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    80
 static Bool Protect0 = FALSE;
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 913
diff changeset
    81
 static Bool UseConsole = FALSE;
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    82
@@ -234,6 +237,8 @@ OPENCONSOLE:
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 784
diff changeset
    83
 
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 784
diff changeset
    84
 	    if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 784
diff changeset
    85
 		xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
778
03bf0470eca1 6876992 [vconsole] Ctrl+Alt+F12 switchs to blank console screen with hotkeys property turned-off.
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 766
diff changeset
    86
+
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    87
+	    xf86ConsoleFd = xf86Info.consoleFd;
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 784
diff changeset
    88
 	}
766
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    89
 #endif
ac938085d487 6480003 Xorg should support virtual console on Solaris
Aaron Zang <Aaron.Zang@Sun.COM>
parents:
diff changeset
    90