summaryrefslogtreecommitdiff
path: root/src/efi-boot-generator/efi-boot-generator.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-05-16 18:11:12 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-05-16 18:11:32 -0400
commit4652c56c59682f153c34d30b410534e4f0c6fd6a (patch)
treeaa3b99cbbc89b0aad23cd36c323ace20851995e5 /src/efi-boot-generator/efi-boot-generator.c
parent0dfb89d3c29163e17d081ac10237aa55d2a95d85 (diff)
Use fflush_and_check() in more places
Diffstat (limited to 'src/efi-boot-generator/efi-boot-generator.c')
-rw-r--r--src/efi-boot-generator/efi-boot-generator.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/efi-boot-generator/efi-boot-generator.c b/src/efi-boot-generator/efi-boot-generator.c
index 128df85c26..42b21f57de 100644
--- a/src/efi-boot-generator/efi-boot-generator.c
+++ b/src/efi-boot-generator/efi-boot-generator.c
@@ -123,9 +123,9 @@ int main(int argc, char *argv[]) {
"Options=umask=0077,noauto\n",
what);
- fflush(f);
- if (ferror(f)) {
- log_error_errno(errno, "Failed to write mount unit file: %m");
+ r = fflush_and_check(f);
+ if (r < 0) {
+ log_error_errno(r, "Failed to write mount unit file: %m");
return EXIT_FAILURE;
}
@@ -144,9 +144,9 @@ int main(int argc, char *argv[]) {
"Where=/boot\n"
"TimeoutIdleSec=120\n", f);
- fflush(f);
- if (ferror(f)) {
- log_error_errno(errno, "Failed to write automount unit file: %m");
+ r = fflush_and_check(f);
+ if (r < 0) {
+ log_error_errno(r, "Failed to write automount unit file: %m");
return EXIT_FAILURE;
}