chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
journalctl: clean up how we log errors
[elogind.git]
/
src
/
shared
/
generator.c
diff --git
a/src/shared/generator.c
b/src/shared/generator.c
index d48b400b31535af16b9f7cad2570ad80c7668416..81284995f5ab1c2d58ecf68513756abcf72ee3f0 100644
(file)
--- 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;
}