]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: change sd_bus_call_method to bus_call_method (#27518)
authorArthur Shau <sandstorm4999@gmail.com>
Thu, 4 May 2023 01:41:10 +0000 (18:41 -0700)
committerGitHub <noreply@github.com>
Thu, 4 May 2023 01:41:10 +0000 (09:41 +0800)
Migrates the sd_bus_call_method code in run.c to use bus-locator.h api

src/run/run.c

index 41570bf12ebbea796bf373d8127ab37f267ac712..5124436a05174d59f50fa0d44095a5a43a471c44 100644 (file)
@@ -1240,14 +1240,12 @@ static int start_transient_service(sd_bus *bus) {
                         if (r < 0)
                                 return log_error_errno(r, "Failed to connect to system bus: %m");
 
-                        r = sd_bus_call_method(system_bus,
-                                               "org.freedesktop.machine1",
-                                               "/org/freedesktop/machine1",
-                                               "org.freedesktop.machine1.Manager",
-                                               "OpenMachinePTY",
-                                               &error,
-                                               &pty_reply,
-                                               "s", arg_host);
+                        r = bus_call_method(system_bus,
+                                            bus_machine_mgr,
+                                            "OpenMachinePTY",
+                                            &error,
+                                            &pty_reply,
+                                            "s", arg_host);
                         if (r < 0)
                                 return log_error_errno(r, "Failed to get machine PTY: %s", bus_error_message(&error, r));