summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-15 02:46:07 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-15 02:46:07 +0200
commitcf3e247193b49c1907dd85b74f0de1530948016c (patch)
treea70df6e6661921da7807d816278f406f8e7c09d2
parent53ec43c61d2f0e19c41640c63ec034b2f8cedb89 (diff)
dbus: tighten match rules a bit
-rw-r--r--src/dbus.c9
-rw-r--r--src/dbus.h26
2 files changed, 19 insertions, 16 deletions
diff --git a/src/dbus.c b/src/dbus.c
index a14dbda9d2..69ed641e62 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -332,7 +332,7 @@ static void bus_toggle_timeout(DBusTimeout *timeout, void *data) {
log_error("Failed to rearm timer: %s", strerror(-r));
}
-static DBusHandlerResult api_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) {
+static DBusHandlerResult api_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) {
Manager *m = data;
DBusError error;
DBusMessage *reply = NULL;
@@ -438,7 +438,7 @@ oom:
return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
-static DBusHandlerResult system_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) {
+static DBusHandlerResult system_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) {
Manager *m = data;
DBusError error;
@@ -457,7 +457,7 @@ static DBusHandlerResult system_bus_message_filter(DBusConnection *connection,
log_error("Warning! System D-Bus connection terminated.");
bus_done_system(m);
- } if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Agent", "Released")) {
+ } else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Agent", "Released")) {
const char *cgroup;
if (!dbus_message_get_args(message, &error,
@@ -733,6 +733,7 @@ int bus_init_system(Manager *m) {
dbus_bus_add_match(m->system_bus,
"type='signal',"
"interface='org.freedesktop.systemd1.Agent',"
+ "member='Released',"
"path='/org/freedesktop/systemd1/agent'",
&error);
@@ -798,6 +799,7 @@ int bus_init_api(Manager *m) {
"type='signal',"
"sender='"DBUS_SERVICE_DBUS"',"
"interface='"DBUS_INTERFACE_DBUS"',"
+ "member='NameOwnerChange',"
"path='"DBUS_PATH_DBUS"'",
&error);
@@ -813,6 +815,7 @@ int bus_init_api(Manager *m) {
"type='signal',"
"sender='"DBUS_SERVICE_DBUS"',"
"interface='org.freedesktop.systemd1.Activator',"
+ "member='ActivationRequest',"
"path='"DBUS_PATH_DBUS"'",
&error);
diff --git a/src/dbus.h b/src/dbus.h
index 3ad299ed38..264bdff625 100644
--- a/src/dbus.h
+++ b/src/dbus.h
@@ -37,23 +37,23 @@ typedef struct BusProperty {
} BusProperty;
#define BUS_PROPERTIES_INTERFACE \
- " <interface name=\"org.freedesktop.DBus.Properties\">\n" \
- " <method name=\"Get\">\n" \
- " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
- " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
- " <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \
- " </method>\n" \
- " <method name=\"GetAll\">\n" \
- " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
+ " <interface name=\"org.freedesktop.DBus.Properties\">\n" \
+ " <method name=\"Get\">\n" \
+ " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
+ " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
+ " <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \
+ " </method>\n" \
+ " <method name=\"GetAll\">\n" \
+ " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
" <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
- " </method>\n" \
+ " </method>\n" \
" </interface>\n"
#define BUS_INTROSPECTABLE_INTERFACE \
- " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \
- " <method name=\"Introspect\">\n" \
- " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \
- " </method>\n" \
+ " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \
+ " <method name=\"Introspect\">\n" \
+ " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \
+ " </method>\n" \
" </interface>\n"
int bus_init_system(Manager *m);