summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-07-29 20:43:54 +0200
committerDaniel Mack <github@zonque.org>2015-07-29 20:43:54 +0200
commit65c85ef5118d88bc0d3459b6e8854bf1846190b9 (patch)
tree3c60aceafd3cbf6fe12eb6db934350950f4425cd /src/boot
parent1051d049a8a5811135d83a89a430c5be846866ca (diff)
parentdacd6cee76a08331b8c8616c5f30f70ee49aa2f9 (diff)
Merge pull request #779 from poettering/fflush-and-check
tree-wide: port everything over to fflush_and_check()
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/bootctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index 091ea375d3..359fde9998 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -489,9 +489,9 @@ static int copy_file(const char *from, const char *to, bool force) {
}
} while (!feof(f));
- fflush(g);
- if (ferror(g)) {
- r = log_error_errno(EIO, "Failed to write \"%s\": %m", to);
+ r = fflush_and_check(g);
+ if (r < 0) {
+ log_error_errno(r, "Failed to write \"%s\": %m", to);
goto error;
}
@@ -519,7 +519,7 @@ static int copy_file(const char *from, const char *to, bool force) {
return 0;
error:
- unlink(p);
+ (void) unlink(p);
return r;
}