]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: convert a machine1.Manager call to BusLocator
authorDavid Tardon <dtardon@redhat.com>
Tue, 23 May 2023 18:33:16 +0000 (20:33 +0200)
committerDavid Tardon <dtardon@redhat.com>
Wed, 24 May 2023 06:33:22 +0000 (08:33 +0200)
src/journal/journalctl.c

index b0b95311f1cfbce76e60c18df97a922359f6f298..5f3a121ac9fef57df3c94b56c8a171090be3a7ed 100644 (file)
@@ -21,6 +21,7 @@
 #include "alloc-util.h"
 #include "build.h"
 #include "bus-error.h"
+#include "bus-locator.h"
 #include "bus-util.h"
 #include "catalog.h"
 #include "chase.h"
@@ -2246,15 +2247,7 @@ static int run(int argc, char *argv[]) {
                 if (r < 0)
                         return log_error_errno(r, "Failed to open system bus: %m");
 
-                r = sd_bus_call_method(
-                                bus,
-                                "org.freedesktop.machine1",
-                                "/org/freedesktop/machine1",
-                                "org.freedesktop.machine1.Manager",
-                                "OpenMachineRootDirectory",
-                                &error,
-                                &reply,
-                                "s", arg_machine);
+                r = bus_call_method(bus, bus_machine_mgr, "OpenMachineRootDirectory", &error, &reply, "s", arg_machine);
                 if (r < 0)
                         return log_error_errno(r, "Failed to open root directory: %s", bus_error_message(&error, r));