summaryrefslogtreecommitdiff
path: root/src/pty.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/pty.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/pty.c')
-rw-r--r--src/pty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pty.c b/src/pty.c
index 7c592e6..0888f38 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <pthread.h>
#include <pty.h>
#include <signal.h>
#include <stdlib.h>
@@ -131,7 +132,7 @@ static int setup_child(int master, struct winsize *ws)
/* The child should not inherit our signal mask. */
sigemptyset(&sigset);
- ret = sigprocmask(SIG_SETMASK, &sigset, NULL);
+ ret = pthread_sigmask(SIG_SETMASK, &sigset, NULL);
if (ret)
log_warn("cannot reset blocked signals: %m");