summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2026-04-24 16:24:06 +0200
committerMarkus Pettersson <markus.pettersson@mullvad.net>2026-04-24 16:40:14 +0200
commit4fbc35078d711fbd92c679e4ec3d994427cb4df9 (patch)
tree4270473630eef18d97b83ffdf6c257fcdba1061e
parent21b59942c7ee629ac08d0417d492f6544751c758 (diff)
downloadmullvadvpn-4fbc35078d711fbd92c679e4ec3d994427cb4df9.tar.xz
mullvadvpn-4fbc35078d711fbd92c679e4ec3d994427cb4df9.zip
Clean up error logging in is_shutdown_user_initiatedfix-user-init-shutdown-propagation-linux-macos
-rw-r--r--mullvad-daemon/src/shutdown.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/mullvad-daemon/src/shutdown.rs b/mullvad-daemon/src/shutdown.rs
index 2e7473b34f..7f7c09315e 100644
--- a/mullvad-daemon/src/shutdown.rs
+++ b/mullvad-daemon/src/shutdown.rs
@@ -32,19 +32,15 @@ mod platform {
/// be assumed that the machine is shutting down.
#[cfg(target_os = "linux")]
pub fn is_shutdown_user_initiated() -> bool {
- match talpid_dbus::systemd::is_host_running() {
- Ok(is_host_running) => is_host_running,
- Err(err) => {
- log::error!(
- "{}",
- talpid_types::ErrorExt::display_chain_with_msg(
- &err,
- "Failed to determine if host is shutting down, assuming it is shutting down"
- )
- );
- false
- }
- }
+ use talpid_types::ErrorExt;
+ talpid_dbus::systemd::is_host_running()
+ .map_err(|err| {
+ err.display_chain_with_msg(
+ "Failed to determine if host is shutting down, assuming it is shutting down",
+ )
+ })
+ .inspect_err(|err| log::error!("{err}"))
+ .unwrap_or(false)
}
/// Currently returns false all of the time to ensure that no leaks occur during shutdown.