summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-05-15 17:06:59 +0200
committerLennart Poettering <lennart@poettering.net>2015-05-15 17:06:59 +0200
commit2929b4a6ad8146d3ae2cc65d9b24ae3c4951c92f (patch)
tree528e3f683cbcb3040a41a5c53c57ae752f319182
parenta2c7f25aec23b6d74ff5cf169e38159754e6dfe8 (diff)
generator: use fflush_and_check() where appropriate
-rw-r--r--src/shared/generator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c
index d48b400b31..81284995f5 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -67,9 +67,9 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) {
what,
device);
- fflush(f);
- if (ferror(f))
- return log_error_errno(errno, "Failed to write unit file %s: %m", unit);
+ r = fflush_and_check(f);
+ if (r < 0)
+ return log_error_errno(r, "Failed to write unit file %s: %m", unit);
return 0;
}