diff options
Diffstat (limited to 'src/pulsecore/lock-autospawn.c')
-rw-r--r-- | src/pulsecore/lock-autospawn.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pulsecore/lock-autospawn.c b/src/pulsecore/lock-autospawn.c index 422f5eb2..a9c942fb 100644 --- a/src/pulsecore/lock-autospawn.c +++ b/src/pulsecore/lock-autospawn.c @@ -26,9 +26,11 @@ #include <fcntl.h> #include <errno.h> #include <string.h> -#include <sys/poll.h> #include <signal.h> + +#ifdef HAVE_PTHREAD #include <pthread.h> +#endif #include <pulse/i18n.h> #include <pulse/xmalloc.h> @@ -159,7 +161,7 @@ static void ping(void) { for (;;) { char x = 'x'; - if ((s = write(pipe_fd[1], &x, 1)) == 1) + if ((s = pa_write(pipe_fd[1], &x, 1, NULL)) == 1) break; pa_assert(s < 0); @@ -186,7 +188,7 @@ static void wait_for_ping(void) { if ((k = pa_poll(&pfd, 1, -1)) != 1) { pa_assert(k < 0); pa_assert(errno == EINTR); - } else if ((s = read(pipe_fd[0], &x, 1)) != 1) { + } else if ((s = pa_read(pipe_fd[0], &x, 1, NULL)) != 1) { pa_assert(s < 0); pa_assert(errno == EAGAIN); } @@ -198,7 +200,7 @@ static void empty_pipe(void) { pa_assert(pipe_fd[0] >= 0); - if ((s = read(pipe_fd[0], &x, sizeof(x))) < 1) { + if ((s = pa_read(pipe_fd[0], &x, sizeof(x), NULL)) < 1) { pa_assert(s < 0); pa_assert(errno == EAGAIN); } @@ -207,11 +209,14 @@ static void empty_pipe(void) { static void thread_func(void *u) { int fd; char *lf; + +#ifdef HAVE_PTHREAD sigset_t fullset; /* No signals in this thread please */ sigfillset(&fullset); pthread_sigmask(SIG_BLOCK, &fullset, NULL); +#endif if (!(lf = pa_runtime_path(AUTOSPAWN_LOCK))) { pa_log_warn(_("Cannot access autospawn lock.")); |