summaryrefslogtreecommitdiff
path: root/src/eloop.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-03-25 17:53:16 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-03-25 17:53:16 +0200
commit9e87b853abe33bfc220b43e6b9f871a7ed5c3bb3 (patch)
tree4ab303238aff5e3f6b0e0d996681a1206c4b926e /src/eloop.c
parentf545d9641a4c55ea3c8701b7c0a28714231c5fae (diff)
use pthread_sigmask instead of sigprocmask
pthread is already in our vmem due to our dependencies so link to it explicitly and use pthread_sigmask to avoid buggy sigprocmask in multi-threaded applications. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/eloop.c')
-rw-r--r--src/eloop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/eloop.c b/src/eloop.c
index 239c6d5..f0bae2b 100644
--- a/src/eloop.c
+++ b/src/eloop.c
@@ -32,6 +32,7 @@
*/
#include <errno.h>
+#include <pthread.h>
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -540,7 +541,7 @@ int ev_eloop_add_signal(struct ev_eloop *loop, struct ev_signal *sig,
return ret;
}
- sigprocmask(SIG_BLOCK, &mask, NULL);
+ pthread_sigmask(SIG_BLOCK, &mask, NULL);
sig->cb = cb;
sig->data = data;
ev_signal_ref(sig);
@@ -617,7 +618,7 @@ static int signal_new(struct ev_signal_shared **out, struct ev_eloop *loop,
if (ret)
goto err_sig;
- sigprocmask(SIG_BLOCK, &mask, NULL);
+ pthread_sigmask(SIG_BLOCK, &mask, NULL);
sig->next = loop->sig_list;
loop->sig_list = sig;