X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=dbus-manager.c;h=732e586e9292c01dec4be5a61dcad975e149cebd;hp=bdc82df070aeaff9c8ea205134d2c0378e528107;hb=dbd4655d8937fb870a6ec42889081ecd4b83ca98;hpb=47be870bd83fb3719dffc3ee9348a409ab762a14
diff --git a/dbus-manager.c b/dbus-manager.c
index bdc82df07..732e586e9 100644
--- a/dbus-manager.c
+++ b/dbus-manager.c
@@ -47,6 +47,24 @@
" " \
" " \
" " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
" " \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE
@@ -287,6 +305,31 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection
if (!dbus_message_iter_close_container(&iter, &sub))
goto oom;
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1", "Subscribe")) {
+ char *client;
+
+ if (!(client = strdup(dbus_message_get_sender(message))))
+ goto oom;
+
+ r = set_put(m->subscribed, client);
+
+ if (r < 0)
+ return bus_send_error_reply(m, message, NULL, r);
+
+ if (!(reply = dbus_message_new_method_return(message)))
+ goto oom;
+
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1", "Unsubscribe")) {
+ char *client;
+
+ if (!(client = set_remove(m->subscribed, (char*) dbus_message_get_sender(message))))
+ return bus_send_error_reply(m, message, NULL, -ENOENT);
+
+ free(client);
+
+ if (!(reply = dbus_message_new_method_return(message)))
+ goto oom;
+
} else if (dbus_message_is_method_call(message, "org.freedesktop.DBus.Introspectable", "Introspect")) {
char *introspection = NULL;
FILE *f;