Lines 1-80
Link Here
|
1 |
--- programs/luit/luit.c Fri Mar 5 01:48:51 2004 |
1 |
--- programs/luit/luit.c.orig Thu Apr 8 05:14:16 2004 |
2 |
+++ programs/luit/luit.c Sun Jul 18 09:01:22 2004 |
2 |
+++ programs/luit/luit.c Thu Apr 8 05:20:18 2004 |
3 |
@@ -45,6 +45,8 @@ |
3 |
@@ -545,9 +545,11 @@ |
4 |
#include "charset.h" |
4 |
#endif |
5 |
#include "iso2022.h" |
5 |
installHandler(SIGCHLD, sigchldHandler); |
|
|
6 |
|
7 |
+/* Disabled, appears to break luit. |
8 |
rc = copyTermios(0, pty); |
9 |
if(rc < 0) |
10 |
FatalError("Couldn't copy terminal settings\n"); |
11 |
+*/ |
6 |
|
12 |
|
7 |
+static int p2c_waitpipe[2]; |
13 |
rc = setRawTermios(); |
8 |
+static int c2p_waitpipe[2]; |
14 |
if(rc < 0) |
9 |
static Iso2022Ptr inputState = NULL, outputState = NULL; |
|
|
10 |
|
11 |
static char *child_argv0 = NULL; |
12 |
@@ -462,6 +464,8 @@ |
13 |
exit(1); |
14 |
} |
15 |
|
16 |
+ pipe(p2c_waitpipe); |
17 |
+ pipe(c2p_waitpipe); |
18 |
pid = fork(); |
19 |
if(pid < 0) { |
20 |
perror("Couldn't fork"); |
21 |
@@ -470,8 +474,12 @@ |
22 |
|
23 |
if(pid == 0) { |
24 |
close(pty); |
25 |
+ close(p2c_waitpipe[1]); |
26 |
+ close(c2p_waitpipe[0]); |
27 |
child(line, path, child_argv); |
28 |
} else { |
29 |
+ close(p2c_waitpipe[0]); |
30 |
+ close(c2p_waitpipe[1]); |
31 |
free(child_argv); |
32 |
free(path); |
33 |
free(line); |
34 |
@@ -486,6 +494,7 @@ |
35 |
{ |
36 |
int tty; |
37 |
int pgrp; |
38 |
+ char tmp[10]; |
39 |
|
40 |
close(0); |
41 |
close(1); |
42 |
@@ -501,6 +510,7 @@ |
43 |
kill(getppid(), SIGABRT); |
44 |
exit(1); |
45 |
} |
46 |
+ write(c2p_waitpipe[1],"1",1); |
47 |
|
48 |
if(tty != 0) |
49 |
dup2(tty, 0); |
50 |
@@ -512,6 +522,9 @@ |
51 |
if(tty > 2) |
52 |
close(tty); |
53 |
|
54 |
+ read(p2c_waitpipe[0],tmp,1); |
55 |
+ close(c2p_waitpipe[1]); |
56 |
+ close(p2c_waitpipe[0]); |
57 |
execvp(path, argv); |
58 |
perror("Couldn't exec"); |
59 |
exit(1); |
60 |
@@ -535,7 +548,9 @@ |
61 |
int i; |
62 |
int val; |
63 |
int rc; |
64 |
+ char tmp[10]; |
65 |
|
66 |
+ read(c2p_waitpipe[0],tmp,1); |
67 |
if(verbose) { |
68 |
reportIso2022(outputState); |
69 |
} |
70 |
@@ -564,6 +579,9 @@ |
71 |
|
72 |
setWindowSize(0, pty); |
73 |
|
74 |
+ write(p2c_waitpipe[1],"1",1); |
75 |
+ close(c2p_waitpipe[0]); |
76 |
+ close(p2c_waitpipe[1]); |
77 |
for(;;) { |
78 |
rc = waitForInput(0, pty); |
79 |
|
80 |
|