1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2025-01-25 05:42:03 +05:30

reverse-ramdisk.c: flush file buffer on each write

This commit is contained in:
パチュリー・ノーレッジ 2023-12-27 21:30:42 +03:00
parent bb43a5dc53
commit eae82bcceb
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -9,7 +9,7 @@ production purposes.
GCC/Clang/TCC: Compile with -DTEST to set macro TEST as defined, with -DDEBUG
to enable debug mode
To-Do: error handling on line 179, function fread()
To-Do: error handling on line 184, function fread()
*/
#include <errno.h>
@ -154,6 +154,11 @@ int tf_write(int ID, size_t offset, void* data, size_t data_size) {
if (bytes_written != data_size)
return -1;
if (fdatasync(file) == -1) {
line_fail(-1);
return -1;
}
return 0;
}