summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/core-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/core-util.c')
-rw-r--r--src/pulsecore/core-util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 62a63761..5becdef0 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -1323,3 +1323,16 @@ void *pa_will_need(const void *p, size_t l) {
return (void*) p;
}
+
+void pa_close_pipe(int fds[2]) {
+ pa_assert(fds);
+
+ if (fds[0] >= 0)
+ pa_assert_se(pa_close(fds[0]) == 0);
+
+ if (fds[1] >= 0)
+ pa_assert_se(pa_close(fds[1]) == 0);
+
+ fds[0] = fds[1] = -1;
+}
+