Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-07-12 18:18:48 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-07-12 18:27:26 +0300
commitbae987be12b12b18a4e7952a25dba2101f5da1d6 (patch)
tree33959a920cbec9fd57d0170c64100e2972b4a4ce /winsup/cygwin/sigproc.cc
parent948d40e4829e9a6895e6b831ebcb688af849fb90 (diff)
Cygwin: sigpending: don't report pending signals for other threads
The sigpending mechanism failed to check if the pending signal was a process-wide signal, or a signal for the curent thread. Fix that by adding a matching conditional to wait_sig's __SIGPENDING code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index cba1af785..900facd58 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -1335,8 +1335,13 @@ wait_sig (VOID *)
*pack.mask = 0;
tl_entry = cygheap->find_tls (pack.sigtls);
while ((q = q->next))
- if (pack.sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo)))
- *pack.mask |= bit;
+ {
+ /* Skip thread-specific signals for other threads. */
+ if (q->sigtls && pack.sigtls != q->sigtls)
+ continue;
+ if (pack.sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo)))
+ *pack.mask |= bit;
+ }
cygheap->unlock_tls (tl_entry);
}
break;