From 31f56c7be55a36d022505ff9fe4cfa55441a77c1 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Tue, 8 Jun 2021 18:05:55 +0300 Subject: [PATCH] daemon: exit with 0 both in case of a signal and in case of disconnection systemd stops wireplumber with SIGTERM and this should exit gracefully. if wireplumber is started by other means, it may just stop when pipewire stops... that's also fine --- src/main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index b57b3bb7..5cc8c861 100644 --- a/src/main.c +++ b/src/main.c @@ -16,8 +16,7 @@ static G_DEFINE_QUARK (wireplumber-daemon, wp_domain_daemon); enum WpExitCode { - WP_CODE_DISCONNECTED = 0, - WP_CODE_INTERRUPTED, + WP_CODE_OK = 0, WP_CODE_OPERATION_FAILED, WP_CODE_INVALID_ARGUMENT, }; @@ -316,16 +315,14 @@ on_disconnected (WpCore *core, WpDaemon * d) /* something else triggered the exit; let's not change the message */ if (d->exit_message) return; - - daemon_exit_static_str (d, WP_CODE_DISCONNECTED, - "disconnected from pipewire"); + daemon_exit_static_str (d, WP_CODE_OK, "disconnected from pipewire"); } static gboolean signal_handler (gpointer data) { WpDaemon *d = data; - daemon_exit_static_str (d, WP_CODE_INTERRUPTED, "interrupted by signal"); + daemon_exit_static_str (d, WP_CODE_OK, "stopped by signal"); return G_SOURCE_CONTINUE; }