diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-04-06 02:46:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-04-06 02:46:13 +0200 |
commit | 017803e242b21ae35eed968e0a5f5310379a2e73 (patch) | |
tree | e87a338e69b346009a99ea8e4a84ac40fd0fbf0f | |
parent | service: fix units with more than one socket (diff) | |
download | systemd-017803e242b21ae35eed968e0a5f5310379a2e73.tar.xz systemd-017803e242b21ae35eed968e0a5f5310379a2e73.zip |
systemctl: properly parse JobNew signals
https://bugzilla.redhat.com/show_bug.cgi?id=693274
-rw-r--r-- | src/systemctl.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index eab4bf30c4..00db47f125 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -2840,8 +2840,20 @@ static DBusHandlerResult monitor_filter(DBusConnection *connection, DBusMessage else printf("Unit %s removed.\n", id); - } else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Manager", "JobNew") || - dbus_message_is_signal(message, "org.freedesktop.systemd1.Manager", "JobRemoved")) { + } else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Manager", "JobNew")) { + uint32_t id; + const char *path; + + if (!dbus_message_get_args(message, &error, + DBUS_TYPE_UINT32, &id, + DBUS_TYPE_OBJECT_PATH, &path, + DBUS_TYPE_INVALID)) + log_error("Failed to parse message: %s", bus_error_message(&error)); + else + printf("Job %u added.\n", id); + + + } else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Manager", "JobRemoved")) { uint32_t id; const char *path, *result; @@ -2851,10 +2863,8 @@ static DBusHandlerResult monitor_filter(DBusConnection *connection, DBusMessage DBUS_TYPE_STRING, &result, DBUS_TYPE_INVALID)) log_error("Failed to parse message: %s", bus_error_message(&error)); - else if (streq(dbus_message_get_member(message), "JobNew")) - printf("Job %u added.\n", id); else - printf("Job %u removed.\n", id); + printf("Job %u removed (result=%s).\n", id, result); } else if (dbus_message_is_signal(message, "org.freedesktop.DBus.Properties", "PropertiesChanged")) { |