diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-03-25 17:53:16 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-03-25 17:53:16 +0200 |
commit | 9e87b853abe33bfc220b43e6b9f871a7ed5c3bb3 (patch) | |
tree | 4ab303238aff5e3f6b0e0d996681a1206c4b926e /src/pty.c | |
parent | f545d9641a4c55ea3c8701b7c0a28714231c5fae (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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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"); |