#include "build.h"
#include "bus-common-errors.h"
#include "bus-error.h"
+#include "bus-locator.h"
#include "bus-map-properties.h"
#include "format-table.h"
#include "hostname-setup.h"
/* This obtains one string property, and copy it if 'ret' is set, or print it otherwise. */
- r = sd_bus_get_property(
- bus,
- "org.freedesktop.hostname1",
- "/org/freedesktop/hostname1",
- "org.freedesktop.hostname1",
- attr,
- &error, &reply, "s");
+ r = bus_get_property(bus, bus_hostname, attr, &error, &reply, "s");
if (r < 0)
return log_error_errno(r, "Could not get property: %s", bus_error_message(&error, r));
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
const char *text = NULL;
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.hostname1",
- "/org/freedesktop/hostname1",
- "org.freedesktop.hostname1",
- "Describe",
- &error,
- &reply,
- NULL);
+ r = bus_call_method(bus, bus_hostname, "Describe", &error, &reply, NULL);
if (r < 0)
return log_error_errno(r, "Could not get description: %s", bus_error_message(&error, r));
if (!error)
error = &e;
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.hostname1",
- "/org/freedesktop/hostname1",
- "org.freedesktop.hostname1",
- method,
- error, NULL,
- "sb", value, arg_ask_password);
+ r = bus_call_method(bus, bus_hostname, method, error, NULL, "sb", value, arg_ask_password);
if (r < 0)
return log_error_errno(r, "Could not set %s: %s", target, bus_error_message(error, r));