diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-07-29 20:31:07 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-07-29 20:31:07 +0200 |
commit | dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 (patch) | |
tree | 7a7d73f2ac1f909255361781ca923365b6c9b7c3 /src/libsystemd/sd-bus/bus-match.c | |
parent | 8388607b5851574e50a6e65db98135b793b08910 (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/libsystemd/sd-bus/bus-match.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-match.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c index 132b37526e..e4cbd793ed 100644 --- a/src/libsystemd/sd-bus/bus-match.c +++ b/src/libsystemd/sd-bus/bus-match.c @@ -914,6 +914,7 @@ char *bus_match_to_string(struct bus_match_component *components, unsigned n_com char *buffer = NULL; size_t size = 0; unsigned i; + int r; if (n_components <= 0) return strdup(""); @@ -942,8 +943,8 @@ char *bus_match_to_string(struct bus_match_component *components, unsigned n_com fputc('\'', f); } - fflush(f); - if (ferror(f)) + r = fflush_and_check(f); + if (r < 0) return NULL; return buffer; |