6824625.patch revision 1276
792N/Adiff --git a/luit.c b/luit.c
792N/Aindex 0ece7b6..a0b62cb 100644
792N/A--- a/luit.c
792N/A+++ b/luit.c
792N/A@@ -25,6 +25,7 @@ THE SOFTWARE.
792N/A #endif
792N/A
792N/A #include <stdio.h>
792N/A+#include <X11/Xosdefs.h>
792N/A #include <stdlib.h>
792N/A #include <string.h>
792N/A #include <locale.h>
792N/A@@ -36,6 +37,7 @@ THE SOFTWARE.
792N/A #include <stdarg.h>
792N/A #include <sys/ioctl.h>
792N/A #include <signal.h>
792N/A+#include <termios.h>
792N/A
792N/A #include "luit.h"
792N/A #include "sys.h"
792N/A@@ -483,9 +485,11 @@ setup_io(int pty)
792N/A #endif
792N/A installHandler(SIGCHLD, sigchldHandler);
792N/A
792N/A+#ifndef sun
792N/A rc = copyTermios(0, pty);
792N/A if (rc < 0)
792N/A FatalError("Couldn't copy terminal settings\n");
943N/A+#endif
792N/A
792N/A rc = setRawTermios();
919N/A if (rc < 0)
919N/A@@ -627,6 +631,10 @@ child(char *line, char *path, char *const argv[])
919N/A write_waitpipe(c2p_waitpipe);
919N/A }
919N/A
919N/A+#ifdef sun
919N/A+ restoreTermios_1(tty, TCSAFLUSH);
919N/A+#endif
919N/A+
919N/A if (tty != 0)
919N/A dup2(tty, 0);
919N/A if (tty != 1)
919N/Adiff --git a/sys.c b/sys.c
919N/Aindex 8463b05..adda4b5 100644
919N/A--- a/sys.c
919N/A+++ b/sys.c
919N/A@@ -24,6 +24,7 @@ THE SOFTWARE.
792N/A # include "config.h"
792N/A #endif
+#include <X11/Xosdefs.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -246,6 +247,14 @@ restoreTermios(void)
}
int
+restoreTermios_1(int fd, int opt)
+{
+ if(!saved_tio_valid)
+ return -1;
+ return tcsetattr(fd, opt, &saved_tio);
+}
+
+int
setRawTermios(void)
{
struct termios tio;
diff --git a/sys.h b/sys.h
index 5bfe0d2..3d95f20 100644
--- a/sys.h
+++ b/sys.h
@@ -38,6 +38,7 @@ int installHandler(int signum, void (*handler) (int));
int copyTermios(int sfd, int dfd);
int saveTermios(void);
int restoreTermios(void);
+int restoreTermios_1(int fd, int opt);
int setRawTermios(void);
char *my_basename(char *path);
int allocatePty(int *pty_return, char **line_return);