diff options
author | David Tardon <dtardon@redhat.com> | 2023-05-23 20:09:37 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2023-05-24 08:23:59 +0200 |
commit | b71471684afa7972b6328e99a554098c032c0caf (patch) | |
tree | 98b8a7549162ca63bc73af384edad675cd94dc59 /src/portable | |
parent | core/slice: shorten code a bit (diff) | |
download | systemd-b71471684afa7972b6328e99a554098c032c0caf.tar.xz systemd-b71471684afa7972b6328e99a554098c032c0caf.zip |
tree-wide: convert more system1.Manager calls to BusLocator
Diffstat (limited to 'src/portable')
-rw-r--r-- | src/portable/portable.c | 9 | ||||
-rw-r--r-- | src/portable/portablectl.c | 14 |
2 files changed, 5 insertions, 18 deletions
diff --git a/src/portable/portable.c b/src/portable/portable.c index e5f2f38a21..7ab3ac6e97 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -4,6 +4,7 @@ #include "bus-common-errors.h" #include "bus-error.h" +#include "bus-locator.h" #include "chase.h" #include "conf-files.h" #include "copy.h" @@ -780,13 +781,7 @@ static int unit_file_is_active( _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL, *reply = NULL; const char *at, *prefix, *joined; - r = sd_bus_message_new_method_call( - bus, - &m, - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", - "ListUnitsByPatterns"); + r = bus_message_new_method_call(bus, &m, bus_systemd_mgr, "ListUnitsByPatterns"); if (r < 0) return r; diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index eec9c63d0b..39f17a8de7 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -242,13 +242,7 @@ static int maybe_reload(sd_bus **bus) { if (r < 0) return r; - r = sd_bus_message_new_method_call( - *bus, - &m, - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", - "Reload"); + r = bus_message_new_method_call(*bus, &m, bus_systemd_mgr, "Reload"); if (r < 0) return bus_log_create_error(r); @@ -566,12 +560,10 @@ static int maybe_enable_disable(sd_bus *bus, const char *path, bool enable) { if (!names) return log_oom(); - r = sd_bus_message_new_method_call( + r = bus_message_new_method_call( bus, &m, - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", + bus_systemd_mgr, enable ? "EnableUnitFilesWithFlags" : "DisableUnitFilesWithFlags"); if (r < 0) return bus_log_create_error(r); |