tfix a deadlock. - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 99c75f3c503b7b3d667c251e90170bf7e10037ce
DIR parent 0e25d6094f3afc39eea454adcbcb01827906ba3e
HTML Author: rsc <devnull@localhost>
Date: Tue, 20 Apr 2004 15:16:18 +0000
fix a deadlock.
Diffstat:
M src/cmd/9term/bsdpty.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
DIR diff --git a/src/cmd/9term/bsdpty.c b/src/cmd/9term/bsdpty.c
t@@ -106,7 +106,13 @@ setecho(int fd, int newe)
if(old != newe){
ttmode.c_lflag &= ~ECHO;
ttmode.c_lflag |= newe;
- if(tcsetattr(fd, TCSADRAIN, &ttmode) < 0)
+ /*
+ * I tried using TCSADRAIN here, but that causes
+ * hangs if there is any output waiting for us.
+ * I guess TCSADRAIN is intended for use by our
+ * clients, not by us.
+ */
+ if(tcsetattr(fd, 0, &ttmode) < 0)
fprint(2, "tcsetattr: %r\n");
}
return old;