mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
systemctl: also ignore ENOENT in checking inhibitors
Fixes a bug caused by804874d26a. Follow-up fora1417e5563. Fixes #35757.
This commit is contained in:
committed by
Luca Boccassi
parent
156f90cf62
commit
084f361b50
@@ -152,9 +152,9 @@ int logind_check_inhibitors(enum action a) {
|
||||
return 0;
|
||||
|
||||
r = acquire_bus_full(BUS_FULL, /* graceful = */ true, &bus);
|
||||
if (r == -ECONNREFUSED && geteuid() == 0)
|
||||
return 0; /* When D-Bus is not running, allow root to force a shutdown. E.g. when running at
|
||||
* the emergency console. */
|
||||
if (ERRNO_IS_NEG_DISCONNECT(r) && geteuid() == 0)
|
||||
return 0; /* When D-Bus is not running (ECONNREFUSED) or D-Bus socket is not created (ENOENT),
|
||||
* allow root to force a shutdown. E.g. when running at the emergency console. */
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user