chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
mount: relabel both before and after a mount, just in case
[elogind.git]
/
src
/
util.c
diff --git
a/src/util.c
b/src/util.c
index a1686ed3892deffa3f7776073c132a49c0cdf5e2..5daafdf7c2088d78d19fe93b05629bc83d22e87e 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-513,7
+513,16
@@
int write_one_line_file(const char *fn, const char *line) {
if (!endswith(line, "\n"))
fputc('\n', f);
- r = 0;
+ fflush(f);
+
+ if (ferror(f)) {
+ if (errno != 0)
+ r = -errno;
+ else
+ r = -EIO;
+ } else
+ r = 0;
+
finish:
fclose(f);
return r;