[PATCH v3 3/6] Cygwin: signal: Ignore SIGSTOP while process is already stopping

Takashi Yano takashi.yano@nifty.ne.jp
Wed Mar 12 03:27:29 GMT 2025


On Linux, SIGSTOP while the process is stopping is ignored. With
this patch, SIGSTOP is processed as a success with no effect while
the process is already stopping.

Fixes: 8f8eeb70ba73 ("* exceptions.cc (sigpacket::process): ...")
Reviewed-by:
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
---
 winsup/cygwin/exceptions.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 73cfc7967..18a566c45 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -1482,7 +1482,10 @@ sigpacket::process ()
     }
   else if (ISSTATE (myself, PID_STOPPED))
     {
-      rc = -1;		/* Don't send signals when stopped */
+      if (si.si_signo == SIGSTOP)
+	rc = 1;		/* Ignore (discard) SIGSTOP */
+      else
+	rc = -1;	/* Don't send signals when stopped */
       goto done;
     }
   else if (!sigtls)
-- 
2.45.1



More information about the Cygwin-patches mailing list