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

@ -71,8 +71,8 @@ class _pinfo;
void __stdcall proc_terminate ();
void __stdcall sigproc_init ();
bool __reg1 pid_exists (pid_t);
int __reg3 sig_send (_pinfo *, siginfo_t&, class _cygtls * = NULL);
int __reg3 sig_send (_pinfo *, int, class _cygtls * = NULL);
sigset_t __reg3 sig_send (_pinfo *, siginfo_t&, class _cygtls * = NULL);
sigset_t __reg3 sig_send (_pinfo *, int, class _cygtls * = NULL);
void __stdcall signal_fixup_after_exec ();
void __stdcall sigalloc ();
@ -109,7 +109,7 @@ class lock_signals
public:
lock_signals ()
{
worked = sig_send (NULL, __SIGHOLD) == 0;
worked = (bool) sig_send (NULL, __SIGHOLD) == 0;
}
operator int () const
{