summaryrefslogtreecommitdiff
path: root/src/core/dbus-manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-07-29 20:31:07 +0200
committerLennart Poettering <lennart@poettering.net>2015-07-29 20:31:07 +0200
commitdacd6cee76a08331b8c8616c5f30f70ee49aa2f9 (patch)
tree7a7d73f2ac1f909255361781ca923365b6c9b7c3 /src/core/dbus-manager.c
parent8388607b5851574e50a6e65db98135b793b08910 (diff)
tree-wide: port everything over to fflush_and_check()
Some places invoked fflush() directly with their own manual error checking, let's unify all that by using fflush_and_check(). This also unifies the general error paths of fflush()+rename() file writers.
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r--src/core/dbus-manager.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index d8b39bdf5f..5722e3c2bb 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1069,10 +1069,9 @@ static int method_dump(sd_bus_message *message, void *userdata, sd_bus_error *er
manager_dump_units(m, f, NULL);
manager_dump_jobs(m, f, NULL);
- fflush(f);
-
- if (ferror(f))
- return -ENOMEM;
+ r = fflush_and_check(f);
+ if (r < 0)
+ return r;
return sd_bus_reply_method_return(message, "s", dump);
}