diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-04-18 19:56:14 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-04-18 19:56:14 +0900 |
commit | 98b6f23d98c5c75f96abd91860a2dccbebe7ffda (patch) | |
tree | 6046f8c226a4d8e6ec029f4104e06ab6917a8737 /winsup | |
parent | b58b5a96601f9e7424e4cb21aa0b9b2915daa49c (diff) | |
download | newlib-98b6f23d98c5c75f96abd91860a2dccbebe7ffda.zip newlib-98b6f23d98c5c75f96abd91860a2dccbebe7ffda.tar.gz newlib-98b6f23d98c5c75f96abd91860a2dccbebe7ffda.tar.bz2 |
Cygwin: pty: Fix deadlock caused by Ctrl-C in setup_pseudoconsole().
- If Ctrl-C is pressed just after setup_pseudoconsole() is called,
mintty stops to respond a while when CPU load is high. This patch
fixes the issue.
Addresses: https://cygwin.com/pipermail/cygwin/2022-April/251272.html
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/spawn.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 4004571..c9e1fb6 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -679,8 +679,12 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, HANDLE h_stdin = handle (fileno_stdin, false); if (h_stdin == ptys_primary->get_handle_nat ()) stdin_is_ptys = true; + if (reset_sendsig) + myself->sendsig = myself->exec_sendsig; ptys_primary->setup_for_non_cygwin_app (nopcon, envblock, stdin_is_ptys); + if (reset_sendsig) + myself->sendsig = NULL; ptys_primary->get_duplicated_handle_set (&ptys_handle_set); ptys_ttyp = (tty *) ptys_primary->tc (); ptys_need_cleanup = true; |