diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-01-05 15:10:33 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-01-05 15:19:13 +0100 |
commit | 8207b8321bbbcbd19a345deb77d455d98e6ffb84 (patch) | |
tree | c313340f96264a558a41336e62a6da5f8c2209b5 /src/login | |
parent | 5ca99dfabda20927a0d47e5f19339d1b48f82f7a (diff) | |
download | systemd-8207b8321bbbcbd19a345deb77d455d98e6ffb84.tar.gz |
logind: do not propagate error in delayed action
If the action failed, we should log about the issue, and continue.
Exiting would bring the graphical session down, which of course is not
appreciated by users.
As documented in previous commits, a non-negative return from the callback
doesn't matter, so the callback is simplified a bit.
Fixes #21991.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-dbus.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index a97d826234..c05c0d02cc 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1654,7 +1654,6 @@ error: } int manager_dispatch_delayed(Manager *manager, bool timeout) { - _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; Inhibitor *offending = NULL; int r; @@ -1686,10 +1685,9 @@ int manager_dispatch_delayed(Manager *manager, bool timeout) { manager->action_unit = NULL; manager->action_what = 0; - return r; } - return 1; + return 1; /* We did some work. */ } static int manager_inhibit_timeout_handler( @@ -1698,13 +1696,11 @@ static int manager_inhibit_timeout_handler( void *userdata) { Manager *manager = userdata; - int r; assert(manager); assert(manager->inhibit_timeout_source == s); - r = manager_dispatch_delayed(manager, true); - return (r < 0) ? r : 0; + return manager_dispatch_delayed(manager, true); } static int delay_shutdown_or_sleep( |