]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core dbus: Check that flush works with memstream 1639/head
authorNicolas Cornu <ncornu@aldebaran.com>
Wed, 21 Oct 2015 16:17:12 +0000 (18:17 +0200)
committerNicolas Cornu <ncornu@aldebaran.com>
Wed, 21 Oct 2015 16:17:12 +0000 (18:17 +0200)
src/core/dbus-cgroup.c
src/core/dbus-service.c

index f334dc928dd91e7565f27a92b8543dba5546f86d..affb9973041da1badec985353c5a8dfa35036620 100644 (file)
@@ -421,7 +421,9 @@ int bus_cgroup_set_property(
                                                 fprintf(f, "BlockIOWriteBandwidth=%s %" PRIu64 "\n", a->path, a->bandwidth);
                         }
 
-                        fflush(f);
+                        r = fflush_and_check(f);
+                        if (r < 0)
+                                return r;
                         unit_write_drop_in_private(u, mode, name, buf);
                 }
 
@@ -495,7 +497,9 @@ int bus_cgroup_set_property(
                         LIST_FOREACH(device_weights, a, c->blockio_device_weights)
                                 fprintf(f, "BlockIODeviceWeight=%s %" PRIu64 "\n", a->path, a->weight);
 
-                        fflush(f);
+                        r = fflush_and_check(f);
+                        if (r < 0)
+                                return r;
                         unit_write_drop_in_private(u, mode, name, buf);
                 }
 
@@ -640,7 +644,9 @@ int bus_cgroup_set_property(
                         LIST_FOREACH(device_allow, a, c->device_allow)
                                 fprintf(f, "DeviceAllow=%s %s%s%s\n", a->path, a->r ? "r" : "", a->w ? "w" : "", a->m ? "m" : "");
 
-                        fflush(f);
+                        r = fflush_and_check(f);
+                        if (r < 0)
+                                return r;
                         unit_write_drop_in_private(u, mode, name, buf);
                 }
 
index b636f8ba6a467e1383736eede865ea955b2cba2a..fe2a4a3b377a7edf7da17ec3e3c7a1210d18706e 100644 (file)
@@ -243,7 +243,9 @@ static int bus_service_set_transient_property(
                                         a);
                         }
 
-                        fflush(f);
+                        r = fflush_and_check(f);
+                        if (r < 0)
+                                return r;
                         unit_write_drop_in_private(UNIT(s), mode, name, buf);
                 }