Allow fsync() to fail on special files
This commit is contained in:
parent
ce8703cea0
commit
052d2ffc9a
@ -3472,7 +3472,8 @@ write_file (const char *filename, const void *data, size_t data_len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fwrite (data, data_len, 1, fp);
|
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);
|
fclose (fp);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
|
Loading…
Reference in New Issue
Block a user