diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-04-15 17:21:23 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-05-05 22:27:03 +0200 |
commit | 6a7e98aacada79e273ddcad7335a7be7c2add801 (patch) | |
tree | 91836f8c6941a478a7af4de631dc069b02a2991e /src/shared/bus-log-control-api.c | |
parent | logind,importd,hostnamed,localed,timedated,machined,resolved: add option pars... (diff) | |
download | systemd-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.c | 19 |
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), +}; |