X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fdbus-device.c;h=168c8c8c722e126256da87808dd6e57ec04bd1f8;hp=83764783adc11a3373c8e7af7ad996f1da6943d3;hb=b4f10a5e8956d26f0bc6b9aef12846b57caee08b;hpb=e99e38bbdcca3fe5956823bdb3d38544ccf93221 diff --git a/src/dbus-device.c b/src/dbus-device.c index 83764783a..168c8c8c7 100644 --- a/src/dbus-device.c +++ b/src/dbus-device.c @@ -22,23 +22,28 @@ #include "dbus-unit.h" #include "dbus-device.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_INTROSPECTABLE_INTERFACE \ + "\n" + +const char bus_device_interface[] = BUS_DEVICE_INTERFACE; + +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(u->meta.manager, c, message, INTROSPECTION, properties); }