diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2016-01-26 21:35:45 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2016-01-26 21:35:45 +0100 |
commit | 052d2ffc9a3141ef2bb771f70190ed7a0bb9da44 (patch) | |
tree | dc1b292be032ee1dc06d4513630e993371a650cf | |
parent | ce8703cea0e78fd62b9279e0cffbff2b5f2372ef (diff) | |
download | liberty-052d2ffc9a3141ef2bb771f70190ed7a0bb9da44.tar.gz liberty-052d2ffc9a3141ef2bb771f70190ed7a0bb9da44.tar.xz liberty-052d2ffc9a3141ef2bb771f70190ed7a0bb9da44.zip |
Allow fsync() to fail on special files
-rw-r--r-- | liberty.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |