chiark / gitweb /
core: OOM really shouldn't be considered a deserialization parse failure
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Dec 2014 23:15:13 +0000 (00:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 2 Dec 2014 12:23:03 +0000 (13:23 +0100)
src/core/dbus.c
src/core/manager.c

index 79cf414..87da933 100644 (file)
@@ -1144,15 +1144,20 @@ void bus_track_serialize(sd_bus_track *t, FILE *f) {
 
 int bus_track_deserialize_item(char ***l, const char *line) {
         const char *e;
+        int r;
 
         assert(l);
         assert(line);
 
         e = startswith(line, "subscribed=");
         if (!e)
-                return -EINVAL;
+                return 0;
+
+        r = strv_extend(l, e);
+        if (r < 0)
+                return r;
 
-        return strv_extend(l, e);
+        return 1;
 }
 
 int bus_track_coldplug(Manager *m, sd_bus_track **t, char ***l) {
index 7b25500..5fbb375 100644 (file)
@@ -2394,8 +2394,15 @@ 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)
-                        log_warning("Unknown serialization item '%s'", l);
+                } else {
+                        int k;
+
+                        k = bus_track_deserialize_item(&m->deserialized_subscribed, l);
+                        if (k < 0)
+                                log_debug_errno(k, "Failed to deserialize bus tracker object: %m");
+                        else if (k == 0)
+                                log_debug("Unknown serialization item '%s'", l);
+                }
         }
 
         for (;;) {