Cygwin: pty: Switch input and output pipes individually.

- Previously, input and output pipes were switched together between
  the traditional pty and the pseudo console. However, for example,
  if stdin is redirected to another device, it is better to leave
  input pipe traditional pty side even for non-cygwin program. This
  patch realizes such behaviour.
This commit is contained in:
Takashi Yano
2019-09-14 06:48:14 +09:00
committed by Ken Brown
parent cac5f8781a
commit 3355a6d4b9
8 changed files with 174 additions and 102 deletions

View File

@@ -3156,10 +3156,9 @@ fhandler_console::get_console_process_id (DWORD pid, bool match)
tmp = 0;
for (DWORD i=0; i<num; i++)
if ((match && list[i] == pid) || (!match && list[i] != pid))
{
tmp = list[i];
break;
}
/* Last one is the oldest. */
/* https://github.com/microsoft/terminal/issues/95 */
tmp = list[i];
HeapFree (GetProcessHeap (), 0, list);
return tmp;
}