From: Lennart Poettering Date: Fri, 15 May 2015 15:06:59 +0000 (+0200) Subject: generator: use fflush_and_check() where appropriate X-Git-Tag: v220~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2929b4a6ad8146d3ae2cc65d9b24ae3c4951c92f;p=thirdparty%2Fsystemd.git generator: use fflush_and_check() where appropriate --- diff --git a/src/shared/generator.c b/src/shared/generator.c index d48b400b315..81284995f5a 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; }