diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/cpulimit.c | 6 | ||||
-rw-r--r-- | src/daemon/main.c | 10 |
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(); |