summaryrefslogtreecommitdiffstats
path: root/src/shared/bus-log-control-api.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-15 17:21:23 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-05 22:27:03 +0200
commit6a7e98aacada79e273ddcad7335a7be7c2add801 (patch)
tree91836f8c6941a478a7af4de631dc069b02a2991e /src/shared/bus-log-control-api.c
parentlogind,importd,hostnamed,localed,timedated,machined,resolved: add option pars... (diff)
downloadsystemd-6a7e98aacada79e273ddcad7335a7be7c2add801.tar.xz
systemd-6a7e98aacada79e273ddcad7335a7be7c2add801.zip
sd-bus: add helper struct for interface definitions
The idea is to have a static table that defines the dbus API. The vtable is defined right next to the interface name and path because they are logically connected.
Diffstat (limited to 'src/shared/bus-log-control-api.c')
-rw-r--r--src/shared/bus-log-control-api.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/shared/bus-log-control-api.c b/src/shared/bus-log-control-api.c
index ffc52c7774..a1d0d17291 100644
--- a/src/shared/bus-log-control-api.c
+++ b/src/shared/bus-log-control-api.c
@@ -107,17 +107,8 @@ static const sd_bus_vtable log_control_vtable[] = {
SD_BUS_VTABLE_END,
};
-int bus_log_control_api_register(sd_bus *bus) {
- int r;
-
- r = sd_bus_add_object_vtable(
- bus,
- NULL,
- "/org/freedesktop/LogControl1",
- "org.freedesktop.LogControl1",
- log_control_vtable, NULL);
- if (r < 0)
- return log_error_errno(r, "Failed to register service API object: %m");
-
- return 0;
-}
+const BusObjectImplementation log_control_object = {
+ "/org/freedesktop/LogControl1",
+ "org.freedesktop.LogControl1",
+ .vtables = BUS_VTABLES(log_control_vtable),
+};