sleep: minor modernization for lock_all_homes

This commit is contained in:
Mike Yuan 2023-10-26 23:50:50 +08:00
parent 78c21009bf
commit 122f6f1eaa
No known key found for this signature in database
GPG key ID: 417471C0A40F58B3

View file

@ -213,9 +213,9 @@ static int lock_all_homes(void) {
/* Let's synchronously lock all home directories managed by homed that have been marked for it. This
* way the key material required to access these volumes is hopefully removed from memory. */
r = sd_bus_open_system(&bus);
r = bus_connect_system_systemd(&bus);
if (r < 0)
return log_warning_errno(r, "Failed to connect to system bus, ignoring: %m");
return log_error_errno(r, "Failed to connect to system bus: %m");
r = bus_message_new_method_call(bus, &m, bus_home_mgr, "LockAllHomes");
if (r < 0)