Browse code

Add flush to File device writes

Andrew Alderwick authored on 06/11/2021 21:21:41
Showing 1 changed files
... ...
@@ -114,8 +114,11 @@ file_write(void *src, Uint16 len, Uint8 flags)
114 114
 		if((f = fopen(current_filename, (flags & 0x01) ? "ab" : "wb")) != NULL)
115 115
 			state = FILE_WRITE;
116 116
 	}
117
-	if(state == FILE_WRITE)
118
-		return fwrite(src, 1, len, f);
117
+	if(state == FILE_WRITE) {
118
+		Uint16 ret = fwrite(src, 1, len, f);
119
+		fflush(f);
120
+		return ret;
121
+	}
119 122
 	return 0;
120 123
 }
121 124