[newlib-cygwin] Cygwin: pty: Fix state mismatch caused in octave gui.
Corinna Vinschen
corinna@sourceware.org
Fri Jan 17 09:21:00 GMT 2020
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7e6c96d6e1485b52b4243d0cd9699f2063645660
commit 7e6c96d6e1485b52b4243d0cd9699f2063645660
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date: Thu Jan 16 20:04:47 2020 +0900
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.
Diff:
---
winsup/cygwin/spawn.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 08d52bb..f7c6dd5 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;
More information about the Cygwin-cvs
mailing list