Cygwin: return full sigset_t from sig_send

So far sig_send's return type is int.  The problem with this is
that sig_send returns a sigset_t on __SIGPENDING, and sigset_t
is defined as long type.  So the function only returns the lower
32 bit of sigset_t, which is fine on 32 bit, but casts away the
pending RT signals on 64 bit.

Fix this by changing the return type of sig_send to sigset_t, so
as not to narrow down the sigset when returning from handling
__SIGPENDING.  Make sure to cast correctly in all invocations
of sig_send.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-07-12 16:32:45 +02:00
parent 0d24a86822
commit 948d40e482
5 changed files with 12 additions and 12 deletions

View File

@ -264,7 +264,7 @@ _pinfo::kill (siginfo_t& si)
if (si.si_signo == 0)
res = 0;
else if ((res = sig_send (this, si)))
else if ((res = (int) sig_send (this, si)))
{
sigproc_printf ("%d = sig_send, %E ", res);
res = -1;
@ -718,7 +718,7 @@ sigqueue (pid_t pid, int sig, const union sigval value)
si.si_signo = sig;
si.si_code = SI_QUEUE;
si.si_value = value;
return sig_send (dest, si);
return (int) sig_send (dest, si);
}
extern "C" int