commit 99c75f3c503b7b3d667c251e90170bf7e10037ce from: rsc date: Tue Apr 20 15:16:18 2004 UTC fix a deadlock. commit - 0e25d6094f3afc39eea454adcbcb01827906ba3e commit + 99c75f3c503b7b3d667c251e90170bf7e10037ce blob - b5e09195fa989a598cea0d184cf80c28602f1aeb blob + 0de9137db61693d17cbd68ba2ba916377611dd90 --- src/cmd/9term/bsdpty.c +++ src/cmd/9term/bsdpty.c @@ -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;