]> err.no Git - systemd/commitdiff
systemctl: fix parsing of DBus reply in 'dot'
authorMichal Schmidt <mschmidt@redhat.com>
Sat, 7 Aug 2010 09:01:08 +0000 (11:01 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 7 Aug 2010 16:08:03 +0000 (18:08 +0200)
"systemctl dot" has been broken since the addition of the "Following="
property.

src/systemctl.c

index 3ca146447aa4c181b9c2e127aaaa2766f206a6e4..1844638ba234ead83829d8c24579520739d8f98b 100644 (file)
@@ -489,7 +489,7 @@ static int dot(DBusConnection *bus, char **args, unsigned n) {
 
         dbus_message_iter_recurse(&iter, &sub);
         while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
-                const char *id, *description, *load_state, *active_state, *sub_state, *unit_path;
+                const char *id, *description, *load_state, *active_state, *sub_state, *following, *unit_path;
 
                 if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRUCT) {
                         log_error("Failed to parse reply.");
@@ -504,6 +504,7 @@ static int dot(DBusConnection *bus, char **args, unsigned n) {
                     bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &load_state, true) < 0 ||
                     bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &active_state, true) < 0 ||
                     bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &sub_state, true) < 0 ||
+                    bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &following, true) < 0 ||
                     bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_OBJECT_PATH, &unit_path, true) < 0) {
                         log_error("Failed to parse reply.");
                         r = -EIO;