about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-09-02 15:19:37 -0400
committerRich Felker <dalias@aerifal.cx>2013-09-02 15:19:37 -0400
commitb4b9743c0003b9538cbc90c602f55c0ed3f16d17 (patch)
tree5e90acc5b7b669c8abfe6eefd9a83f80e04471c1
parent3c0501d28c1491ce9a4f675e9e223a8dfd9e134c (diff)
downloadmusl-b4b9743c0003b9538cbc90c602f55c0ed3f16d17.tar.gz
musl-b4b9743c0003b9538cbc90c602f55c0ed3f16d17.tar.xz
musl-b4b9743c0003b9538cbc90c602f55c0ed3f16d17.zip
fix mips-specific bug in synccall (too little space for signal mask)
switch to the new __block_all_sigs/__restore_sigs internal API to
clean up the code too.
-rw-r--r--src/thread/synccall.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/thread/synccall.c b/src/thread/synccall.c
index 90ad1e25..4127a413 100644
--- a/src/thread/synccall.c
+++ b/src/thread/synccall.c
@@ -43,7 +43,7 @@ void __synccall(void (*func)(void *), void *ctx)
 	pthread_t self;
 	struct sigaction sa;
 	struct chain *next;
-	uint64_t oldmask;
+	sigset_t oldmask;
 
 	if (!libc.threads_minus_1) {
 		func(ctx);
@@ -52,8 +52,7 @@ void __synccall(void (*func)(void *), void *ctx)
 
 	__inhibit_ptc();
 
-	__syscall(SYS_rt_sigprocmask, SIG_BLOCK, SIGALL_SET,
-		&oldmask, _NSIG/8);
+	__block_all_sigs(&oldmask);
 
 	sem_init(&chaindone, 0, 0);
 	sem_init(&chainlock, 0, 1);
@@ -86,8 +85,7 @@ void __synccall(void (*func)(void *), void *ctx)
 		sem_post(&cur->sem);
 	}
 
-	__syscall(SYS_rt_sigprocmask, SIG_SETMASK,
-		&oldmask, 0, _NSIG/8);
+	__restore_sigs(&oldmask);
 
 	__release_ptc();
 }