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 <[email protected]>
---
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