https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c0d7a921bb806ab92f8f05baeaf0e489ee51d3ce
commit c0d7a921bb806ab92f8f05baeaf0e489ee51d3ce Author: Takashi Yano <takashi.y...@nifty.ne.jp> Date: Wed Mar 12 08:41:18 2025 +0900 Cygwin: signal: Do not clear signals in the queue Currently, sigpacket::process() clears some signals from the queue. For instance, SIGSTOP clears SIGCONT and SIGCONT clears SIGSTOP, etc. These might be needed by previous queue design, however, new queue design does not require that. On the contrary, that causes signal lost. With this patch, these sig_clear() calls are removed. Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257582.html Fixes: 1fd5e000ace5 ("import winsup-2000-02-17 snapshot") Reported-by: Christian Franke <christian.fra...@t-online.de> Reviewed-by: Corinna Vinschen <cori...@vinschen.de> Signed-off-by: Takashi Yano <takashi.y...@nifty.ne.jp> Diff: --- winsup/cygwin/exceptions.cc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index d71345eb3..e2a2054cd 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1436,12 +1436,6 @@ _cygtls::handle_SIGCONT () myself->stopsig = 0; InterlockedAnd ((LONG *) &myself->process_state, ~PID_STOPPED); - - /* Clear pending stop signals */ - sig_clear (SIGSTOP, false); - sig_clear (SIGTSTP, false); - sig_clear (SIGTTIN, false); - sig_clear (SIGTTOU, false); } int @@ -1547,15 +1541,7 @@ sigpacket::process () if (si.si_signo == SIGKILL) goto exit_sig; if (si.si_signo == SIGSTOP) - { - sig_clear (SIGCONT, false); - goto stop; - } - - /* Clear pending SIGCONT on stop signals */ - if (si.si_signo == SIGTSTP || si.si_signo == SIGTTIN - || si.si_signo == SIGTTOU) - sig_clear (SIGCONT, false); + goto stop; if (handler == (void *) SIG_DFL) {