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:
@ -3311,7 +3311,7 @@ pthread_kill (pthread_t thread, int sig)
|
||||
rval = ESRCH;
|
||||
else if (sig)
|
||||
{
|
||||
rval = sig_send (NULL, si, thread->cygtls);
|
||||
rval = (int) sig_send (NULL, si, thread->cygtls);
|
||||
if (rval == -1)
|
||||
rval = get_errno ();
|
||||
}
|
||||
@ -3354,7 +3354,7 @@ pthread_sigqueue (pthread_t *thread, int sig, const union sigval value)
|
||||
si.si_value = value;
|
||||
si.si_pid = myself->pid;
|
||||
si.si_uid = myself->uid;
|
||||
return sig_send (NULL, si, (*thread)->cygtls);
|
||||
return (int) sig_send (NULL, si, (*thread)->cygtls);
|
||||
}
|
||||
|
||||
/* ID */
|
||||
|
Reference in New Issue
Block a user