summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-04 03:36:42 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-04 03:36:42 +0200
commit151b190e79e64824552e01849352ca8f6ac7dedb (patch)
treef3df68fb925ba30f180fede850abb053a26c7596 /src/util.c
parentd7cc2987a50e62af6b806f1f56f526cf219a0d97 (diff)
binfmt: add binfmt tool to set up binfmt_misc at boot
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index a1686ed389..5daafdf7c2 100644
--- 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;