diff options
Diffstat (limited to 'src/efi-boot-generator')
-rw-r--r-- | src/efi-boot-generator/efi-boot-generator.c | 12 |
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; } |