diff --git a/c-programming/reverse-ramdisk.c b/c-programming/reverse-ramdisk.c index 0c2e414..4b5b064 100644 --- a/c-programming/reverse-ramdisk.c +++ b/c-programming/reverse-ramdisk.c @@ -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 @@ -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; }