diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-08-20 02:26:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-08-20 02:31:54 +0200 |
commit | c4e2ceae941d02de5574becbfd3b4db15de2eda3 (patch) | |
tree | c0bda809e0b860f5b0f8e66942dd486c17f2e309 /src/systemctl.c | |
parent | d06dacd0020af7e31ff6089deff339b00ed979e3 (diff) |
dbus: follow standardized fdo PropertiesChanged signal spec
Diffstat (limited to 'src/systemctl.c')
-rw-r--r-- | src/systemctl.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index 5bf5e9f38f..30f6b2a1e5 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -2390,14 +2390,23 @@ static DBusHandlerResult monitor_filter(DBusConnection *connection, DBusMessage printf("Job %u removed.\n", id); - } else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Unit", "Changed") || - dbus_message_is_signal(message, "org.freedesktop.systemd1.Job", "Changed")) { + } else if (dbus_message_is_signal(message, "org.freedesktop.DBus.Properties", "PropertiesChanged")) { const char *path, *interface, *property = "Id"; DBusMessageIter iter, sub; path = dbus_message_get_path(message); - interface = dbus_message_get_interface(message); + + if (!dbus_message_get_args(message, &error, + DBUS_TYPE_STRING, &interface, + DBUS_TYPE_INVALID)) { + log_error("Failed to parse message: %s", error.message); + goto finish; + } + + if (!streq(interface, "org.freedesktop.systemd1.Job") && + !streq(interface, "org.freedesktop.systemd1.Unit")) + goto finish; if (!(m = dbus_message_new_method_call( "org.freedesktop.systemd1", @@ -2497,21 +2506,8 @@ static int monitor(DBusConnection *bus, char **args, unsigned n) { dbus_bus_add_match(bus, "type='signal'," "sender='org.freedesktop.systemd1'," - "interface='org.freedesktop.systemd1.Unit'," - "member='Changed'", - &error); - - if (dbus_error_is_set(&error)) { - log_error("Failed to add match: %s", error.message); - r = -EIO; - goto finish; - } - - dbus_bus_add_match(bus, - "type='signal'," - "sender='org.freedesktop.systemd1'," - "interface='org.freedesktop.systemd1.Job'," - "member='Changed'", + "interface='org.freedesktop.DBus.Properties'," + "member='PropertiesChanged'", &error); if (dbus_error_is_set(&error)) { |