diff options
author | Daniel Mack <github@zonque.org> | 2015-07-29 20:43:54 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-07-29 20:43:54 +0200 |
commit | 65c85ef5118d88bc0d3459b6e8854bf1846190b9 (patch) | |
tree | 3c60aceafd3cbf6fe12eb6db934350950f4425cd /src/libsystemd/sd-bus/bus-introspect.c | |
parent | 1051d049a8a5811135d83a89a430c5be846866ca (diff) | |
parent | dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 (diff) |
Merge pull request #779 from poettering/fflush-and-check
tree-wide: port everything over to fflush_and_check()
Diffstat (limited to 'src/libsystemd/sd-bus/bus-introspect.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-introspect.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsystemd/sd-bus/bus-introspect.c b/src/libsystemd/sd-bus/bus-introspect.c index e2f4550c7e..c2233d0cf3 100644 --- a/src/libsystemd/sd-bus/bus-introspect.c +++ b/src/libsystemd/sd-bus/bus-introspect.c @@ -179,10 +179,10 @@ int introspect_finish(struct introspect *i, sd_bus *bus, sd_bus_message *m, sd_b assert(reply); fputs("</node>\n", i->f); - fflush(i->f); - if (ferror(i->f)) - return -ENOMEM; + r = fflush_and_check(i->f); + if (r < 0) + return r; r = sd_bus_message_new_method_return(m, &q); if (r < 0) @@ -204,8 +204,6 @@ void introspect_free(struct introspect *i) { if (i->f) fclose(i->f); - if (i->introspection) - free(i->introspection); - + free(i->introspection); zero(*i); } |