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.
This commit is contained in:
Takashi Yano 2020-01-16 20:04:47 +09:00 committed by Ken Brown
parent 0ac792dfad
commit 680720e58a
1 changed files with 9 additions and 0 deletions

View File

@ -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;