From ede10292d613c222cb4c1d0300bbe907a835e874 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Sat, 6 Nov 2021 21:21:41 +0000 Subject: [PATCH] Add flush to File device writes --- src/devices/file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/devices/file.c b/src/devices/file.c index 8eab577..3cdae78 100644 --- a/src/devices/file.c +++ b/src/devices/file.c @@ -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; }