From d9c4c9509d34ba89db06ff1252f3da18c6fd623b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 12 Sep 2007 00:17:51 +0000 Subject: add new pa_pipe_close() API to close two fds at the same time git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1812 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulse/context.c | 5 +---- src/pulse/mainloop-signal.c | 4 +--- src/pulse/mainloop.c | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src/pulse') diff --git a/src/pulse/context.c b/src/pulse/context.c index 1ed250f9..a39646d3 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -585,10 +585,7 @@ static int context_connect_spawn(pa_context *c) { return 0; fail: - if (fds[0] != -1) - pa_assert_se(pa_close(fds[0]) == 0); - if (fds[1] != -1) - pa_assert_se(pa_close(fds[1]) == 0); + pa_close_pipe(fds); unlock_autospawn_lock_file(c); diff --git a/src/pulse/mainloop-signal.c b/src/pulse/mainloop-signal.c index d2d42d99..b6414c4e 100644 --- a/src/pulse/mainloop-signal.c +++ b/src/pulse/mainloop-signal.c @@ -147,9 +147,7 @@ void pa_signal_done(void) { api->io_free(io_event); io_event = NULL; - pa_assert_se(close(signal_pipe[0]) == 0); - pa_assert_se(close(signal_pipe[1]) == 0); - signal_pipe[0] = signal_pipe[1] = -1; + pa_close_pipe(signal_pipe); api = NULL; } diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index fc373d97..641eded4 100644 --- a/src/pulse/mainloop.c +++ b/src/pulse/mainloop.c @@ -605,10 +605,7 @@ void pa_mainloop_free(pa_mainloop* m) { pa_xfree(m->pollfds); - if (m->wakeup_pipe[0] >= 0) - pa_assert_se(pa_close(m->wakeup_pipe[0]) == 0); - if (m->wakeup_pipe[1] >= 0) - pa_assert_se(pa_close(m->wakeup_pipe[1]) == 0); + pa_close_pipe(m->wakeup_pipe); pa_xfree(m); } -- cgit