mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-09-10 21:45:21 +03:00
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.
This commit is contained in:
@@ -1654,7 +1654,6 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int manager_dispatch_delayed(Manager *manager, bool timeout) {
|
int manager_dispatch_delayed(Manager *manager, bool timeout) {
|
||||||
|
|
||||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||||
Inhibitor *offending = NULL;
|
Inhibitor *offending = NULL;
|
||||||
int r;
|
int r;
|
||||||
@@ -1686,10 +1685,9 @@ int manager_dispatch_delayed(Manager *manager, bool timeout) {
|
|||||||
|
|
||||||
manager->action_unit = NULL;
|
manager->action_unit = NULL;
|
||||||
manager->action_what = 0;
|
manager->action_what = 0;
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1; /* We did some work. */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int manager_inhibit_timeout_handler(
|
static int manager_inhibit_timeout_handler(
|
||||||
@@ -1698,13 +1696,11 @@ static int manager_inhibit_timeout_handler(
|
|||||||
void *userdata) {
|
void *userdata) {
|
||||||
|
|
||||||
Manager *manager = userdata;
|
Manager *manager = userdata;
|
||||||
int r;
|
|
||||||
|
|
||||||
assert(manager);
|
assert(manager);
|
||||||
assert(manager->inhibit_timeout_source == s);
|
assert(manager->inhibit_timeout_source == s);
|
||||||
|
|
||||||
r = manager_dispatch_delayed(manager, true);
|
return manager_dispatch_delayed(manager, true);
|
||||||
return (r < 0) ? r : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int delay_shutdown_or_sleep(
|
static int delay_shutdown_or_sleep(
|
||||||
|
Reference in New Issue
Block a user