summaryrefslogtreecommitdiff
path: root/src/machine/machined-dbus.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-05-02 23:04:27 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-05-07 08:46:43 -0700
commit14456f760768fc5b03f3e90e7c816fda51bdcd25 (patch)
treec59b0adfd169152dc83f52f39e7c7f8c2f97c618 /src/machine/machined-dbus.c
parent5d990cc571af23e2958eba9f18f1b0513008e520 (diff)
downloadsystemd-14456f760768fc5b03f3e90e7c816fda51bdcd25.tar.gz
machine: switch to BusLocator-oriented helpers
Mechanical substitution reducing some verbosity
Diffstat (limited to 'src/machine/machined-dbus.c')
-rw-r--r--src/machine/machined-dbus.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 865ce7baad..cbc549cb76 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -1577,16 +1577,7 @@ int manager_unref_unit(
assert(m);
assert(unit);
- return sd_bus_call_method(
- m->bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "UnrefUnit",
- error,
- NULL,
- "s",
- unit);
+ return bus_call_method(m->bus, bus_systemd_mgr, "UnrefUnit", error, NULL, "s", unit);
}
int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job) {
@@ -1596,15 +1587,7 @@ int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, c
assert(manager);
assert(unit);
- r = sd_bus_call_method(
- manager->bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "StopUnit",
- error,
- &reply,
- "ss", unit, "fail");
+ r = bus_call_method(manager->bus, bus_systemd_mgr, "StopUnit", error, &reply, "ss", unit, "fail");
if (r < 0) {
if (sd_bus_error_has_name(error, BUS_ERROR_NO_SUCH_UNIT) ||
sd_bus_error_has_name(error, BUS_ERROR_LOAD_FAILED)) {
@@ -1641,15 +1624,7 @@ int manager_kill_unit(Manager *manager, const char *unit, int signo, sd_bus_erro
assert(manager);
assert(unit);
- return sd_bus_call_method(
- manager->bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "KillUnit",
- error,
- NULL,
- "ssi", unit, "all", signo);
+ return bus_call_method(manager->bus, bus_systemd_mgr, "KillUnit", error, NULL, "ssi", unit, "all", signo);
}
int manager_unit_is_active(Manager *manager, const char *unit) {