summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_sigwait.c
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2000-10-25 11:46:07 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2000-10-25 11:46:07 +0000
commitc418675341b115befd1bd14cfdead73186b28c36 (patch)
treea5d1017ab6f30f4ccaacdfce7f00cec7aeacc8a4 /lib/libpthread/thread/thr_sigwait.c
parentb3530b82932d77c301f6a9f4b3cb8c9899d1a099 (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_sigwait.c')
-rw-r--r--lib/libpthread/thread/thr_sigwait.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_sigwait.c b/lib/libpthread/thread/thr_sigwait.c
index 6ba685559263..f2c6ea1c1669 100644
--- a/lib/libpthread/thread/thr_sigwait.c
+++ b/lib/libpthread/thread/thr_sigwait.c
@@ -108,10 +108,12 @@ sigwait(const sigset_t *set, int *sig)
* mask because a subsequent sigaction could enable an
* ignored signal.
*/
+ sigemptyset(&tempset);
for (i = 1; i < NSIG; i++) {
if (sigismember(&waitset, i) &&
(_thread_sigact[i - 1].sa_handler == SIG_DFL)) {
_thread_dfl_count[i]++;
+ sigaddset(&tempset, i);
if (_thread_dfl_count[i] == 1) {
if (_thread_sys_sigaction(i,&act,NULL) != 0)
ret = -1;
@@ -151,10 +153,10 @@ sigwait(const sigset_t *set, int *sig)
/* Restore the sigactions: */
act.sa_handler = SIG_DFL;
for (i = 1; i < NSIG; i++) {
- if (sigismember(&waitset, i) &&
- (_thread_sigact[i - 1].sa_handler == SIG_DFL)) {
+ if (sigismember(&tempset, i)) {
_thread_dfl_count[i]--;
- if (_thread_dfl_count == 0) {
+ if ((_thread_sigact[i - 1].sa_handler == SIG_DFL) &&
+ (_thread_dfl_count[i] == 0)) {
if (_thread_sys_sigaction(i,&act,NULL) != 0)
ret = -1;
}