diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2019-07-12 17:32:45 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-07-12 18:27:26 +0300 |
commit | 948d40e4829e9a6895e6b831ebcb688af849fb90 (patch) | |
tree | 3c7c2cb99256a205d709816272ab2b05c30d4850 /winsup/cygwin/sigproc.cc | |
parent | 0d24a86822a5ee73d6a6aa69e2a0118aa1e35204 (diff) |
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>
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 3b6492bb4..cba1af785 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -422,7 +422,7 @@ _cygtls::remove_pending_sigs () extern "C" int sigpending (sigset_t *mask) { - 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; *mask = outset; @@ -503,7 +503,7 @@ exit_thread (DWORD res) ExitThread (res); } -int __reg3 +sigset_t __reg3 sig_send (_pinfo *p, int sig, _cygtls *tls) { siginfo_t si = {}; @@ -516,7 +516,7 @@ sig_send (_pinfo *p, int sig, _cygtls *tls) If pinfo *p == NULL, send to the current process. If sending to this process, wait for notification that a signal has completed before returning. */ -int __reg3 +sigset_t __reg3 sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls) { int rc = 1; @@ -748,7 +748,7 @@ out: if (si.si_signo != __SIGPENDING) /* nothing */; else if (!rc) - rc = (int) pending; + rc = pending; else rc = SIG_BAD_MASK; sigproc_printf ("returning %p from sending signal %d", rc, si.si_signo); |