summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2020-01-16 20:04:47 +0900
committerCorinna Vinschen <corinna@vinschen.de>2020-01-17 10:20:43 +0100
commit7e6c96d6e1485b52b4243d0cd9699f2063645660 (patch)
tree3e7b3a8c4b2138e7af164e7c0db5de9adc0bc39f
parent50e2a63b04bdd018484605fbb954fd1bd5147fa0 (diff)
downloadcygnal-7e6c96d6e1485b52b4243d0cd9699f2063645660.tar.gz
cygnal-7e6c96d6e1485b52b4243d0cd9699f2063645660.tar.bz2
cygnal-7e6c96d6e1485b52b4243d0cd9699f2063645660.zip
Cygwin: pty: Fix state mismatch caused in octave gui.
- In octave gui, sometimes state mismatch between real pty state and state variable occurs. For example, this occurs when 'ls' command is executed in octave gui. This patch fixes the issue.
-rw-r--r--winsup/cygwin/spawn.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 08d52bb28..f7c6dd590 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -947,6 +947,15 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
{
FreeConsole ();
AttachConsole (pid_restore);
+ cygheap_fdenum cfd (false);
+ int fd;
+ while ((fd = cfd.next ()) >= 0)
+ if (cfd->get_major () == DEV_PTYS_MAJOR)
+ {
+ fhandler_pty_slave *ptys =
+ (fhandler_pty_slave *) (fhandler_base *) cfd;
+ ptys->fixup_after_attach (false, fd);
+ }
}
return (int) res;