summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-05-07 23:37:10 -0400
committerRich Felker <dalias@aerifal.cx>2011-05-07 23:37:10 -0400
commit4c4e22d781d75a461097cccc2ecac5adbafb1a59 (patch)
tree0130e1e296075932808e72629256d81cb35458d1
parent99b8a25e941e54537bf39ca2f265c345f393f112 (diff)
downloadmusl-4c4e22d781d75a461097cccc2ecac5adbafb1a59.tar.gz
musl-4c4e22d781d75a461097cccc2ecac5adbafb1a59.tar.bz2
musl-4c4e22d781d75a461097cccc2ecac5adbafb1a59.tar.xz
musl-4c4e22d781d75a461097cccc2ecac5adbafb1a59.zip
optimize compound-literal sigset_t's not to contain useless hurd bits
-rw-r--r--src/internal/pthread_impl.h6
-rw-r--r--src/thread/pthread_create.c4
-rw-r--r--src/time/timer_create.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index 24cbeb25..615713c7 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -79,8 +79,10 @@ struct __timer {
#define SIGCANCEL 33
#define SIGSYSCALL 34
-#define SIGPT_SET ((sigset_t){{[sizeof(long)==4] = 3<<(32*(sizeof(long)>4))}})
-#define SIGTIMER_SET ((sigset_t){{ 0x80000000 }})
+#define SIGPT_SET ((sigset_t *)(unsigned long [1+(sizeof(long)==4)]){ \
+ [sizeof(long)==4] = 3<<(32*(sizeof(long)>4)) })
+#define SIGTIMER_SET ((sigset_t *)(unsigned long [1+(sizeof(long)==4)]){ \
+ 0x80000000 })
int __set_thread_area(void *);
int __libc_sigaction(int, const struct sigaction *, struct sigaction *);
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index 6545539b..0609aab1 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -45,7 +45,7 @@ static int start(void *p)
{
struct pthread *self = p;
if (self->unblock_cancel)
- __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, &SIGPT_SET, 0, 8);
+ __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, SIGPT_SET, 0, 8);
pthread_exit(self->start(self->start_arg));
return 0;
}
@@ -68,7 +68,7 @@ int pthread_create(pthread_t *res, const pthread_attr_t *attr, void *(*entry)(vo
if (!self) return ENOSYS;
if (!libc.threaded) {
- __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, &SIGPT_SET, 0, 8);
+ __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, SIGPT_SET, 0, 8);
libc.threaded = 1;
}
diff --git a/src/time/timer_create.c b/src/time/timer_create.c
index 3bcfa951..1561d797 100644
--- a/src/time/timer_create.c
+++ b/src/time/timer_create.c
@@ -51,7 +51,7 @@ static void install_handler()
.sa_flags = SA_SIGINFO | SA_RESTART
};
__libc_sigaction(SIGTIMER, &sa, 0);
- __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, &SIGTIMER_SET, 0, 8);
+ __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, SIGTIMER_SET, 0, 8);
}
static void *start(void *arg)