Cygwin: pty: Attach to stub process when non-cygwin app inherits pcon.

- If two non-cygwin apps are started simultaneously, attaching to
  pseudo console sometimes fails. This is because the second app
  trys to attach to the process not started yet. This patch avoids
  the issue by attaching to the stub process rather than the other
  non-cygwin app.
This commit is contained in:
Takashi Yano via Cygwin-patches 2021-03-08 22:14:58 +09:00 committed by Corinna Vinschen
parent 07e2ce9f55
commit 850b5a9aae
1 changed files with 1 additions and 1 deletions

View File

@ -3104,7 +3104,7 @@ fhandler_pty_slave::setup_pseudoconsole (bool nopcon)
0, TRUE, DUPLICATE_SAME_ACCESS);
CloseHandle (pcon_owner);
FreeConsole ();
AttachConsole (p->dwProcessId);
AttachConsole (p->exec_dwProcessId);
goto skip_create;
}