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:
---
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;
--
2.51.0