summaryrefslogtreecommitdiff
path: root/src/cryptsetup
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/cryptsetup
parent0dfb89d3c29163e17d081ac10237aa55d2a95d85 (diff)
Use fflush_and_check() in more places
Diffstat (limited to 'src/cryptsetup')
-rw-r--r--src/cryptsetup/cryptsetup-generator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 755ee5d88d..6fad8ad80c 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -176,9 +176,9 @@ static int create_disk(
"ExecStartPost=/sbin/mkswap '/dev/mapper/%s'\n",
name);
- fflush(f);
- if (ferror(f))
- return log_error_errno(errno, "Failed to write file %s: %m", p);
+ r = fflush_and_check(f);
+ if (r < 0)
+ return log_error_errno(r, "Failed to write file %s: %m", p);
from = strjoina("../", n);