X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fdbus-device.c;h=f85ad2daf8fbe2579bd8e67009eb2e7a51b0084b;hp=83764783adc11a3373c8e7af7ad996f1da6943d3;hb=f975e971accc4d50c73ae53167db3df7a7099cf2;hpb=e99e38bbdcca3fe5956823bdb3d38544ccf93221 diff --git a/src/dbus-device.c b/src/dbus-device.c index 83764783a..f85ad2daf 100644 --- a/src/dbus-device.c +++ b/src/dbus-device.c @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. @@ -21,24 +21,38 @@ #include "dbus-unit.h" #include "dbus-device.h" +#include "dbus-common.h" -static const char introspection[] = - DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE - "" - BUS_UNIT_INTERFACE - BUS_PROPERTIES_INTERFACE - " " - " " - " " - BUS_INTROSPECTABLE_INTERFACE - ""; - -DBusHandlerResult bus_device_message_handler(Unit *u, DBusMessage *message) { +#define BUS_DEVICE_INTERFACE \ + " \n" \ + " \n" \ + " \n" + +#define INTROSPECTION \ + DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \ + "\n" \ + BUS_UNIT_INTERFACE \ + BUS_DEVICE_INTERFACE \ + BUS_PROPERTIES_INTERFACE \ + BUS_PEER_INTERFACE \ + BUS_INTROSPECTABLE_INTERFACE \ + "\n" + +#define INTERFACES_LIST \ + BUS_UNIT_INTERFACES_LIST \ + "org.freedesktop.systemd1.Device\0" + +const char bus_device_interface[] _introspect_("Device") = BUS_DEVICE_INTERFACE; + +const char bus_device_invalidating_properties[] = + "SysFSPath\0"; + +DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) { const BusProperty properties[] = { BUS_UNIT_PROPERTIES, { "org.freedesktop.systemd1.Device", "SysFSPath", bus_property_append_string, "s", u->device.sysfs }, { NULL, NULL, NULL, NULL, NULL } }; - return bus_default_message_handler(u->meta.manager, message, introspection, properties); + return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, properties); }