illumos-gate: omit tagged pointers on SPARC, causes panic on UltraI/II systems
[oi-userland.git] / components / x11 / luit / patches / 6824625.patch
blobe9a6e0cad763368d0c83a6e03030c1fe7210669c
1 diff --git a/luit.c b/luit.c
2 index 0ece7b6..a0b62cb 100644
3 --- a/luit.c
4 +++ b/luit.c
5 @@ -25,6 +25,7 @@ THE SOFTWARE.
6 #endif
8 #include <stdio.h>
9 +#include <X11/Xosdefs.h>
10 #include <stdlib.h>
11 #include <string.h>
12 #include <locale.h>
13 @@ -36,6 +37,7 @@ THE SOFTWARE.
14 #include <stdarg.h>
15 #include <sys/ioctl.h>
16 #include <signal.h>
17 +#include <termios.h>
19 #include "luit.h"
20 #include "sys.h"
21 @@ -483,9 +485,11 @@ setup_io(int pty)
22 #endif
23 installHandler(SIGCHLD, sigchldHandler);
25 +#ifndef sun
26 rc = copyTermios(0, pty);
27 if (rc < 0)
28 FatalError("Couldn't copy terminal settings\n");
29 +#endif
31 rc = setRawTermios();
32 if (rc < 0)
33 @@ -627,6 +631,10 @@ child(char *line, char *path, char *const argv[])
34 write_waitpipe(c2p_waitpipe);
37 +#ifdef sun
38 + restoreTermios_1(tty, TCSAFLUSH);
39 +#endif
41 if (tty != 0)
42 dup2(tty, 0);
43 if (tty != 1)
44 diff --git a/sys.c b/sys.c
45 index 8463b05..adda4b5 100644
46 --- a/sys.c
47 +++ b/sys.c
48 @@ -24,6 +24,7 @@ THE SOFTWARE.
49 # include "config.h"
50 #endif
52 +#include <X11/Xosdefs.h>
53 #include <stdlib.h>
54 #include <string.h>
55 #include <stdio.h>
56 @@ -246,6 +247,14 @@ restoreTermios(void)
59 int
60 +restoreTermios_1(int fd, int opt)
62 + if(!saved_tio_valid)
63 + return -1;
64 + return tcsetattr(fd, opt, &saved_tio);
67 +int
68 setRawTermios(void)
70 struct termios tio;
71 diff --git a/sys.h b/sys.h
72 index 5bfe0d2..3d95f20 100644
73 --- a/sys.h
74 +++ b/sys.h
75 @@ -38,6 +38,7 @@ int installHandler(int signum, void (*handler) (int));
76 int copyTermios(int sfd, int dfd);
77 int saveTermios(void);
78 int restoreTermios(void);
79 +int restoreTermios_1(int fd, int opt);
80 int setRawTermios(void);
81 char *my_basename(char *path);
82 int allocatePty(int *pty_return, char **line_return);