summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--signal.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b3974b..52fa0d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
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.
+
* windows.h (THREAD_PRIORITY_ERROR_RETURN): Add.
(THREAD_PRIORITY_LOWEST): Add.
(THREAD_PRIORITY_HIGHEST): Add.
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;
}
}