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:
@ -151,7 +151,7 @@ fhandler_signalfd::write (const void *, size_t)
|
||||
int
|
||||
fhandler_signalfd::poll ()
|
||||
{
|
||||
sigset_t outset = (sigset_t) sig_send (myself, __SIGPENDING, &_my_tls);
|
||||
sigset_t outset = sig_send (myself, __SIGPENDING, &_my_tls);
|
||||
if (outset == SIG_BAD_MASK)
|
||||
return -1;
|
||||
if ((outset & sigset) != 0)
|
||||
|
Reference in New Issue
Block a user