Add flush to File device writes

This commit is contained in:
Andrew Alderwick 2021-11-06 21:21:41 +00:00
parent 8f75ec3801
commit ede10292d6
1 changed files with 5 additions and 2 deletions

View File

@ -114,8 +114,11 @@ file_write(void *src, Uint16 len, Uint8 flags)
if((f = fopen(current_filename, (flags & 0x01) ? "ab" : "wb")) != NULL)
state = FILE_WRITE;
}
if(state == FILE_WRITE)
return fwrite(src, 1, len, f);
if(state == FILE_WRITE) {
Uint16 ret = fwrite(src, 1, len, f);
fflush(f);
return ret;
}
return 0;
}