diff options
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -10,6 +10,8 @@ int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) { + pthread_t thread = pthread_self(); + /* Validate the `how' argument.*/ if (set != NULL) { @@ -30,19 +32,18 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) /* Copy the old mask before modifying it. */ if (oset != NULL) { - memcpy(oset, this->attr->sigmask, sizeof(sigset_t)); + memcpy(oset, thread->attr.sigmask, sizeof(sigset_t)); } if (set != NULL) { - _pthread_threads_thread_t * us = _PTHREAD_THIS; int i; /* FIXME: this code assumes that sigmask is an even multiple of the size of a long integer. */ unsigned long *src = set; - unsigned long *dest = us->attr.sigmask; + unsigned long *dest = thread->attr.sigmask; switch (how) { @@ -61,7 +62,7 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) } case SIG_SET: /* Replace the whole sigmask. */ - memcpy(us->attr.sigmask, set, sizeof(sigset_t)); + memcpy(thread->attr.sigmask, set, sizeof(sigset_t)); break; } } |