diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-06-14 14:53:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-06-14 14:53:46 +0200 |
commit | 6b0f548498cfbc92525846d93241c7cd2875dc41 (patch) | |
tree | c05b2e1859991d8e721c3b01446ffce329bb81ab | |
parent | Merge pull request #9302 from keszybz/drop-my-copyright-and-some-license-tags (diff) | |
download | systemd-6b0f548498cfbc92525846d93241c7cd2875dc41.tar.xz systemd-6b0f548498cfbc92525846d93241c7cd2875dc41.zip |
busctl: use fflush_and_check() where appropriate
-rw-r--r-- | src/busctl/busctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 073005ca6a..b677ac0177 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -14,6 +14,7 @@ #include "busctl-introspect.h" #include "escape.h" #include "fd-util.h" +#include "fileio.h" #include "locale-util.h" #include "log.h" #include "pager.h" @@ -1262,10 +1263,9 @@ static int verb_capture(int argc, char **argv, void *userdata) { if (r < 0) return r; - if (ferror(stdout)) { - log_error("Couldn't write capture file."); - return -EIO; - } + r = fflush_and_check(stdout); + if (r < 0) + return log_error_errno(r, "Couldn't write capture file: %m"); return r; } |