mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
logind-dbus: avoid assertion on HandlePowerKey=factory-reset
The factory-reset action is handled together with the various sleep/shutdown actions, but its not either one. Fixes #39385
This commit is contained in:
committed by
Yu Watanabe
parent
77a92e97eb
commit
8fc02a8cfd
@@ -1946,6 +1946,11 @@ static int send_prepare_for(Manager *m, const HandleActionData *a, bool _active)
|
||||
|
||||
assert(m);
|
||||
assert(a);
|
||||
|
||||
/* Only sleep/shutdown actions emit a signal */
|
||||
if (a->inhibit_what < 0)
|
||||
return 0;
|
||||
|
||||
assert(IN_SET(a->inhibit_what, INHIBIT_SHUTDOWN, INHIBIT_SLEEP));
|
||||
|
||||
/* We need to send both old and new signal for backward compatibility. The newer one allows clients
|
||||
@@ -2163,6 +2168,7 @@ int bus_manager_shutdown_or_sleep_now_or_later(
|
||||
|
||||
delayed =
|
||||
m->inhibit_delay_max > 0 &&
|
||||
a->inhibit_what >= 0 &&
|
||||
manager_is_inhibited(m, a->inhibit_what, NULL, MANAGER_IS_INHIBITED_CHECK_DELAY, UID_INVALID, NULL);
|
||||
|
||||
if (delayed)
|
||||
|
||||
Reference in New Issue
Block a user