aboutsummaryrefslogtreecommitdiff
path: root/liberty.c
diff options
context:
space:
mode:
Diffstat (limited to 'liberty.c')
-rw-r--r--liberty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/liberty.c b/liberty.c
index e61d9cd..7e3c615 100644
--- a/liberty.c
+++ b/liberty.c
@@ -3472,7 +3472,8 @@ write_file (const char *filename, const void *data, size_t data_len,
}
fwrite (data, data_len, 1, fp);
- bool success = !ferror (fp) && !fflush (fp) && !fsync (fileno (fp));
+ bool success = !ferror (fp) && !fflush (fp)
+ && (!fsync (fileno (fp)) || errno == EINVAL);
fclose (fp);
if (!success)