[PATCH v3 2/6] Cygwin: signal: Do not clear signals in the queue
Takashi Yano
takashi.yano@nifty.ne.jp
Wed Mar 12 03:27:28 GMT 2025
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.Franke@t-online.de>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
---
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 a05883e3f..73cfc7967 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)
{
--
2.45.1
More information about the Cygwin-patches
mailing list