Skip to content
Snippets Groups Projects
Commit 9b178896 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix missing fsync for data integrity.

parent 271e2a99
No related branches found
No related tags found
No related merge requests found
......@@ -403,7 +403,12 @@ int fileFlush(int fileID)
{
int retval = 0;
bfile_t *fileptr = file_to_pointer(fileID);
if ( fileptr ) retval = fflush(fileptr->fp);
if ( fileptr )
{
FILE *fp = fileptr->fp;
if (fflush(fp) != 0 || fsync(fileno(fp)) != 0)
retval = errno;
}
return retval;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment