https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ad853bba44cdf8483064354fa1640f6fb77bd4dc

commit ad853bba44cdf8483064354fa1640f6fb77bd4dc
Author: Takashi Yano <[email protected]>
Date:   Tue Mar 10 11:07:06 2026 +0900

    Cygwin: signal: Do not wait for sendsig for non-cygwin process
    
    Waiting for `sendsig` to be non-zero for non-cygwin process is
    pointless, because it never becomes non-zero (see spawn.cc).
    Do not wait `sendsig` for a non-cygwin process.
    
    Fixes: d584454c8231 ("* sigproc.cc (sig_send): Wait for dwProcessId to be 
non-zero as well as sendsig.")
    Signed-off-by: Takashi Yano <[email protected]>
    Reviewed-by: Corinna Vinschen <[email protected]>
    (cherry picked from commit 90556ffea1b6c005333066630e548839bed2cbbf)

Diff:
---
 winsup/cygwin/sigproc.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 0fd7ed3ba..4ff05967b 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -646,9 +646,12 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
     {
       HANDLE dupsig;
       DWORD dwProcessId;
-      DWORD t0 = GetTickCount ();
-      while (GetTickCount () - t0 < 100 && !p->sendsig)
-       yield ();
+      if (!ISSTATE (p, PID_NOTCYGWIN))
+       {
+         DWORD t0 = GetTickCount ();
+         while (GetTickCount () - t0 < 100 && !p->sendsig)
+           yield ();
+       }
       if (p->sendsig)
        {
          dupsig = p->sendsig;

Reply via email to