X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fdbus-snapshot.c;h=0c2f349599fa6022a2bb1c36272b01a6c1112de0;hp=8aeca15254e0870b7d22e54bdb9debba6aae05ea;hb=5ba081b0fb02380cee4c2ff5bc7e05f869eb8415;hpb=e99e38bbdcca3fe5956823bdb3d38544ccf93221 diff --git a/src/dbus-snapshot.c b/src/dbus-snapshot.c index 8aeca1525..0c2f34959 100644 --- a/src/dbus-snapshot.c +++ b/src/dbus-snapshot.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,20 +21,32 @@ #include "dbus-unit.h" #include "dbus-snapshot.h" +#include "dbus-common.h" + +#define BUS_SNAPSHOT_INTERFACE \ + " \n" \ + " \n" \ + " \n" \ + " \n" + +#define INTROSPECTION \ + DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \ + "\n" \ + BUS_UNIT_INTERFACE \ + BUS_SNAPSHOT_INTERFACE \ + BUS_PROPERTIES_INTERFACE \ + BUS_PEER_INTERFACE \ + BUS_INTROSPECTABLE_INTERFACE \ + "\n" + +#define INTERFACES_LIST \ + BUS_UNIT_INTERFACES_LIST \ + "org.freedesktop.systemd1.Snapshot\0" + +const char bus_snapshot_interface[] _introspect_("Snapshot") = BUS_SNAPSHOT_INTERFACE; + +DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) { -static const char introspection[] = - DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE - "" - BUS_UNIT_INTERFACE - BUS_PROPERTIES_INTERFACE - " " - " " - " " - " " - BUS_INTROSPECTABLE_INTERFACE - ""; - -DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusMessage *message) { const BusProperty properties[] = { BUS_UNIT_PROPERTIES, { "org.freedesktop.systemd1.Snapshot", "Cleanup", bus_property_append_bool, "b", &u->snapshot.cleanup }, @@ -54,10 +66,10 @@ DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusMessage *message) { goto oom; } else - return bus_default_message_handler(u->meta.manager, message, introspection, properties); + return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, properties); if (reply) { - if (!dbus_connection_send(u->meta.manager->api_bus, reply, NULL)) + if (!dbus_connection_send(c, reply, NULL)) goto oom; dbus_message_unref(reply);