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 Corinna Vinschen
parent 50e2a63b04
commit 7e6c96d6e1

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;