summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-09-12 00:04:21 +0000
committerLennart Poettering <lennart@poettering.net>2007-09-12 00:04:21 +0000
commit7f92542420ef6085b6f090954052266cc70af8a1 (patch)
tree86640b0497bf7f34c0c7df5b6c36bdf6ec78adea /src/pulse
parent54506ab44a9ac61e79b3a5c632db56bde41beded (diff)
consolidate close() calls to pa_close(), and make sure on every occasion that we handle failures of close() sensibly
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1811 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/context.c8
-rw-r--r--src/pulse/mainloop.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pulse/context.c b/src/pulse/context.c
index ab06aeb9..1ed250f9 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -524,7 +524,7 @@ static int context_connect_spawn(pa_context *c) {
int n;
/* Not required, since fds[0] has CLOEXEC enabled anyway */
- close(fds[0]);
+ pa_assert_se(pa_close(fds[0]) == 0);
if (c->spawn_api.atfork)
c->spawn_api.atfork();
@@ -571,7 +571,7 @@ static int context_connect_spawn(pa_context *c) {
goto fail;
}
- close(fds[1]);
+ pa_assert_se(pa_close(fds[1]) == 0);
c->is_local = 1;
@@ -586,9 +586,9 @@ static int context_connect_spawn(pa_context *c) {
fail:
if (fds[0] != -1)
- close(fds[0]);
+ pa_assert_se(pa_close(fds[0]) == 0);
if (fds[1] != -1)
- close(fds[1]);
+ pa_assert_se(pa_close(fds[1]) == 0);
unlock_autospawn_lock_file(c);
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index 419b74d6..fc373d97 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -606,9 +606,9 @@ void pa_mainloop_free(pa_mainloop* m) {
pa_xfree(m->pollfds);
if (m->wakeup_pipe[0] >= 0)
- close(m->wakeup_pipe[0]);
+ pa_assert_se(pa_close(m->wakeup_pipe[0]) == 0);
if (m->wakeup_pipe[1] >= 0)
- close(m->wakeup_pipe[1]);
+ pa_assert_se(pa_close(m->wakeup_pipe[1]) == 0);
pa_xfree(m);
}