]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep: minor modernization for lock_all_homes
authorMike Yuan <me@yhndnzj.com>
Thu, 26 Oct 2023 15:50:50 +0000 (23:50 +0800)
committerMike Yuan <me@yhndnzj.com>
Fri, 27 Oct 2023 10:11:32 +0000 (18:11 +0800)
src/sleep/sleep.c

index 79d7a49b9900ef726711bc5c9374b6bd99d9ec2a..8dd14e5546812de7d55e22ac30bf44bbd543e8e2 100644 (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)