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/core/manager.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/core/manager.c')
-rw-r--r-- | src/core/manager.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index a1f37bbbb3..ba107d4615 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1701,6 +1701,7 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t ssize_t n; struct signalfd_siginfo sfsi; bool sigchld = false; + int r; assert(m); assert(m->signal_fd == fd); @@ -1809,20 +1810,16 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t f = open_memstream(&dump, &size); if (!f) { - log_warning("Failed to allocate memory stream."); + log_warning_errno(errno, "Failed to allocate memory stream: %m"); break; } manager_dump_units(m, f, "\t"); manager_dump_jobs(m, f, "\t"); - if (ferror(f)) { - log_warning("Failed to write status stream"); - break; - } - - if (fflush(f)) { - log_warning("Failed to flush status stream"); + r = fflush_and_check(f); + if (r < 0) { + log_warning_errno(r, "Failed to write status stream: %m"); break; } |