diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-04-04 03:36:42 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-04-04 03:36:42 +0200 |
commit | 151b190e79e64824552e01849352ca8f6ac7dedb (patch) | |
tree | f3df68fb925ba30f180fede850abb053a26c7596 /src/util.c | |
parent | d7cc2987a50e62af6b806f1f56f526cf219a0d97 (diff) |
binfmt: add binfmt tool to set up binfmt_misc at boot
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 11 |
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; |