]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: console: Fix open() failure when the console owner calls exec().
authorTakashi Yano <takashi.yano@nifty.ne.jp>
Tue, 5 Nov 2024 11:20:21 +0000 (20:20 +0900)
committerTakashi Yano <takashi.yano@nifty.ne.jp>
Tue, 5 Nov 2024 11:42:58 +0000 (20:42 +0900)
commitdf0953aa298c0c6b92b8735c6a703239db36091d
tree85e77f360a39f0ffb746fb151a7a79a158826d42
parent37920d33accdc1f841da25c1ecd8d0ac35c41682
Cygwin: console: Fix open() failure when the console owner calls exec().

Currently, open() tries to attach to the console which is owned by
the console owner process. However, when the owner process calls
exec(), AttachConsole() to dwProcessId may sometimes fail due to
unlucky timing. With this patch, open() tries to attach also to
exec_dwProcessId if attaching to dwProcessId fails. That is, open()
tries to attach to both the stub process and target process to
prevent the above situation.

Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
winsup/cygwin/fhandler/console.cc
This page took 0.026006 seconds and 5 git commands to generate.