Obsolete VTE pre-2.91 ABI
[oi-userland.git] / components / x11 / xorg-server / patches / 19-vt.patch
blobe99d4ec2dc542c44e1d368c3ea021c3770c31978
1 --- a/dix/main.c 2017-02-01 15:05:08.248943479 -0800
2 +++ b/dix/main.c 2017-02-01 15:07:26.499207921 -0800
3 @@ -78,6 +78,8 @@
4 #include <version-config.h>
5 #endif
7 +#include <sys/stat.h>
8 +#include <stdio.h>
9 #include <X11/X.h>
10 #include <X11/Xos.h> /* for unistd.h */
11 #include <X11/Xproto.h>
12 @@ -125,6 +127,36 @@
14 extern void Dispatch(void);
16 +#if defined(sun)
17 +extern const char * GetAuthFilename(void);
18 +static char sym_authfile[40];
20 +#define LOCK_PREFIX "/var/xauth/"
22 +/*
23 + * Setup /var/xauth/$DISPLAY, which is a symlink to the
24 + * actually auth file.
25 +*/
26 +static void
27 +SetupXauthFile(char *filename)
29 + struct stat buf;
31 + snprintf(sym_authfile, 40, LOCK_PREFIX "%s", display);
33 + mkdir(LOCK_PREFIX, S_IRWXU);
35 + remove(sym_authfile);
36 + symlink(filename, sym_authfile);
39 +void
40 +RemoveXauthSymFile(void)
42 + remove(sym_authfile);
44 +#endif
46 CallbackListPtr RootWindowFinalizeCallback = NULL;
48 int
49 @@ -132,6 +164,9 @@
51 int i;
52 HWEventQueueType alwaysCheckForInput[2];
53 +#if defined(sun)
54 + char *xauthfile = NULL;
55 +#endif
57 display = "0";
59 @@ -145,6 +180,12 @@
61 ProcessCommandLine(argc, argv);
63 +#if defined(sun)
64 + xauthfile = GetAuthFilename();
65 + if (xauthfile)
66 + SetupXauthFile(xauthfile);
67 +#endif
69 alwaysCheckForInput[0] = 0;
70 alwaysCheckForInput[1] = 1;
71 while (1) {
72 --- a/hw/xfree86/os-support/solaris/sun_init.c 2017-02-01 15:07:50.575551326 -0800
73 +++ b/hw/xfree86/os-support/solaris/sun_init.c 2017-02-01 15:08:25.999117101 -0800
74 @@ -46,6 +46,9 @@
75 #define CONSOLE_VTNO 1
76 #define SOL_CONSOLE_DEV "/dev/console"
78 +/* For use of VT_SETDISPLOGIN in dtlogin.c */
79 +extern int xf86ConsoleFd;
81 static Bool KeepTty = FALSE;
82 static Bool UseConsole = FALSE;
84 @@ -232,6 +235,8 @@
86 if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
87 xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
89 + xf86ConsoleFd = xf86Info.consoleFd;
91 #endif
93 --- a/os/log.c 2017-02-01 15:08:49.899272429 -0800
94 +++ b/os/log.c 2017-02-01 15:09:43.768274981 -0800
95 @@ -108,6 +108,10 @@
96 void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL;
97 #endif
99 +#ifdef sun
100 +extern void RemoveXauthSymFile(void);
101 +#endif
103 static FILE *logFile = NULL;
104 static int logFileFd = -1;
105 static Bool logFlush = FALSE;
106 @@ -1007,6 +1011,9 @@
107 VErrorFSigSafe(f, args);
108 va_end(args);
109 ErrorFSigSafe("\n");
110 +#ifdef sun
111 + RemoveXauthSymFile();
112 +#endif
113 if (!beenhere)
114 OsVendorFatalError(f, args2);
115 va_end(args2);