summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-21 21:01:21 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-21 21:01:21 +0200
commit2dcc3c69a10f76e0ee9185c863d23ee62d481919 (patch)
tree5d954e728441ed15ddba2d8b23310008cc4b3225 /src
parent91839b49dd6911c1d900e3b5456091eb9941bb8f (diff)
parent1f2f874c3c0e0f4cee7688ee59e2fde669626bc3 (diff)
Merge pull request #1639 from alkino/master
core dbus: Check that flush works with memstream
Diffstat (limited to 'src')
-rw-r--r--src/core/dbus-cgroup.c12
-rw-r--r--src/core/dbus-service.c4
2 files changed, 12 insertions, 4 deletions
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
index f334dc928d..affb997304 100644
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -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);
}
diff --git a/src/core/dbus-service.c b/src/core/dbus-service.c
index b636f8ba6a..fe2a4a3b37 100644
--- a/src/core/dbus-service.c
+++ b/src/core/dbus-service.c
@@ -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);
}