aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>2021-03-08 22:14:58 +0900
committerKen Brown <kbrown@cornell.edu>2021-03-31 11:09:41 -0400
commit0e57ae089a7d6919f040583185f50a55a1577544 (patch)
treef574990506bc7ada15191e2c7a9d509d42de52e0
parent84cd2c0f28d896e305c141b67276dcaa498ece24 (diff)
downloadnewlib-0e57ae089a7d6919f040583185f50a55a1577544.zip
newlib-0e57ae089a7d6919f040583185f50a55a1577544.tar.gz
newlib-0e57ae089a7d6919f040583185f50a55a1577544.tar.bz2
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.
-rw-r--r--winsup/cygwin/fhandler_tty.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index d353c53..baec71e 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -3353,7 +3353,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;
}