diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-03-01 05:34:16 +0300 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-03-01 13:40:46 +0300 |
commit | fbfea31dd9b9ecc4ffb160d91bb046688c3544b9 (patch) | |
tree | 011e1654304e12d4c9270536a5020322acc28ce6 /winsup/cygwin/sigproc.cc | |
parent | 644e8bba07cdb6ca47ebafc766b52951860721d4 (diff) |
Cygwin: pty: Avoid cutting the branch the pty master is sitting on.
- When Ctrl-C terminates a non-cygwin process on a pseudo console,
pty master attaches to the pseudo console first, and send
CTRL_C_EVENT. If the non-cygwin process closes the pseudo console
before the pty master calls FreeConsole(), the pty master process
will crash. With this patch, pty master process takes over the
ownership of the pseudo console, and closes it by myself.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 4d7d273ae..edfdffd7c 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -1392,7 +1392,8 @@ wait_sig (VOID *) sig_held = true; break; case __SIGSETPGRP: - init_console_handler (true); + init_console_handler (::cygheap->ctty + && ::cygheap->ctty->is_console ()); break; case __SIGTHREADEXIT: { |