chiark / gitweb /
dbus: return non-zero return value in the case that prefix won't match
authorLukas Nykryn <lnykryn@redhat.com>
Thu, 20 Nov 2014 15:06:18 +0000 (16:06 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Nov 2014 00:15:20 +0000 (19:15 -0500)
strv_extend returns 0 in the case of success which means that
else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0)
        log_warning("Unknown serialization item '%s'", l);
will be printed when value is added correctly.

src/core/dbus.c
src/core/manager.c

index 9cb198a..ec1c0d4 100644 (file)
@@ -1180,7 +1180,7 @@ int bus_track_deserialize_item(char ***l, const char *line) {
 
         e = startswith(line, "subscribed=");
         if (!e)
-                return 0;
+                return -EINVAL;
 
         return strv_extend(l, e);
 }
index 2bc1058..7abc8a9 100644 (file)
@@ -2408,7 +2408,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
                                 m->kdbus_fd = fdset_remove(fds, fd);
                         }
 
-                } else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0)
+                } else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) < 0)
                         log_warning("Unknown serialization item '%s'", l);
         }