From d6d9fb295d03a411974a148e469465e0f7c59891 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Tue, 4 Jan 2011 11:17:53 +0100 Subject: Clean up includes Instead should be included. That file includes poll.h on platform where it is appropriate. Also remove some unnecessary includes. --- src/pulsecore/lock-autospawn.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/pulsecore/lock-autospawn.c') diff --git a/src/pulsecore/lock-autospawn.c b/src/pulsecore/lock-autospawn.c index 422f5eb2..b5150573 100644 --- a/src/pulsecore/lock-autospawn.c +++ b/src/pulsecore/lock-autospawn.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include -- cgit From bb12ff83564d43566089dd979639c6993ba76665 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Thu, 6 Jan 2011 00:51:33 +0100 Subject: Apply #ifdefs around functionality not available on win32 And also the reverse: around some win32 specific functionality --- src/pulsecore/lock-autospawn.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pulsecore/lock-autospawn.c') diff --git a/src/pulsecore/lock-autospawn.c b/src/pulsecore/lock-autospawn.c index b5150573..1a082db6 100644 --- a/src/pulsecore/lock-autospawn.c +++ b/src/pulsecore/lock-autospawn.c @@ -27,7 +27,10 @@ #include #include #include + +#ifdef HAVE_PTHREAD #include +#endif #include #include @@ -206,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.")); -- cgit From 821562b9bc8d1a9033daaae0fd5373498a085054 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Wed, 5 Jan 2011 19:50:44 +0100 Subject: Use pa_read, pa_write and pa_poll instead of system functions --- src/pulsecore/lock-autospawn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pulsecore/lock-autospawn.c') diff --git a/src/pulsecore/lock-autospawn.c b/src/pulsecore/lock-autospawn.c index 1a082db6..a9c942fb 100644 --- a/src/pulsecore/lock-autospawn.c +++ b/src/pulsecore/lock-autospawn.c @@ -161,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); @@ -188,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); } @@ -200,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); } -- cgit