summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-08-06 06:03:37 +0000
committerrpj <rpj>1998-08-06 06:03:37 +0000
commit20ebb838b7d10a0f315ae399439f71dd7bcba764 (patch)
tree0b65286d4e787352b262f08bc932315eea99717a /signal.c
parent511e3b586fb74bb0cd7359c51069d03f77d88b08 (diff)
Thu Aug 6 15:19:22 1998 Ross Johnson <rpj@swan.canberra.edu.au>
* 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.
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c11
1 files changed, 6 insertions, 5 deletions
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;
}
}