summaryrefslogtreecommitdiffstats
path: root/src/daemon
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-09-12 00:17:51 +0000
committerLennart Poettering <lennart@poettering.net>2007-09-12 00:17:51 +0000
commitd9c4c9509d34ba89db06ff1252f3da18c6fd623b (patch)
treec43528c07e55bd4aaa2cf618056e7679c9c7f14a /src/daemon
parent7f92542420ef6085b6f090954052266cc70af8a1 (diff)
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
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/cpulimit.c6
-rw-r--r--src/daemon/main.c10
2 files changed, 2 insertions, 14 deletions
diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c
index 4f0adc06..0fe11ea6 100644
--- a/src/daemon/cpulimit.c
+++ b/src/daemon/cpulimit.c
@@ -222,11 +222,7 @@ void pa_cpu_limit_done(void) {
api = NULL;
}
- if (the_pipe[0] >= 0)
- pa_assert_se(pa_close(the_pipe[0]) == 0);
- if (the_pipe[1] >= 0)
- pa_assert_se(pa_close(the_pipe[1]) == 0);
- the_pipe[0] = the_pipe[1] = -1;
+ pa_close_pipe(the_pipe);
if (installed) {
pa_assert_se(sigaction(SIGXCPU, &sigaction_prev, NULL) >= 0);
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 0bbddffa..93d4eb6b 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -158,14 +158,6 @@ static void signal_callback(pa_mainloop_api*m, PA_GCC_UNUSED pa_signal_event *e,
}
}
-static void close_pipe(int p[2]) {
- if (p[0] != -1)
- pa_assert_se(pa_close(p[0]) == 0);
- if (p[1] != -1)
- pa_assert_se(pa_close(p[1]) == 0);
- p[0] = p[1] = -1;
-}
-
#define set_env(key, value) putenv(pa_sprintf_malloc("%s=%s", (key), (value)))
#if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)
@@ -745,7 +737,7 @@ finish:
if (valid_pid_file)
pa_pid_file_remove();
- close_pipe(daemon_pipe);
+ pa_close_pipe(daemon_pipe);
#ifdef OS_IS_WIN32
WSACleanup();