From 20ebb838b7d10a0f315ae399439f71dd7bcba764 Mon Sep 17 00:00:00 2001 From: rpj Date: Thu, 6 Aug 1998 06:03:37 +0000 Subject: Thu Aug 6 15:19:22 1998 Ross Johnson * signal.c (pthread_sigmask): Rename SIG_SET to SIG_SETMASK. Cast "set" to (long *) in assignment to passify compiler warning. Add address-of operator & to thread->attr.sigmask in memcpy() call and assignment. (pthread_sigmask): Add address-of operator & to thread->attr.sigmask in memcpy() call and assignment. --- signal.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'signal.c') diff --git a/signal.c b/signal.c index 77fa0dd..6fb9de0 100644 --- a/signal.c +++ b/signal.c @@ -6,6 +6,7 @@ */ #include "pthread.h" +#include "implement.h" int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) @@ -32,7 +33,7 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) /* Copy the old mask before modifying it. */ if (oset != NULL) { - memcpy(oset, thread->attr.sigmask, sizeof(sigset_t)); + memcpy(oset, &(thread->attr.sigmask), sizeof(sigset_t)); } if (set != NULL) @@ -42,8 +43,8 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) /* FIXME: this code assumes that sigmask is an even multiple of the size of a long integer. */ - unsigned long *src = set; - unsigned long *dest = thread->attr.sigmask; + unsigned long *src = (long *) set; + unsigned long *dest = &(thread->attr.sigmask); switch (how) { @@ -60,9 +61,9 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) /* XOR the bitfield longword-wise. */ *src++ ^= *dest++; } - case SIG_SET: + case SIG_SETMASK: /* Replace the whole sigmask. */ - memcpy(thread->attr.sigmask, set, sizeof(sigset_t)); + memcpy(&(thread->attr.sigmask), set, sizeof(sigset_t)); break; } } -- cgit v1.2.3