diff options
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -968,6 +968,14 @@ public: return error("CBlock::WriteToDisk() : ftell failed");
fileout << *this;
+ // Flush stdio buffers and commit to disk before returning
+ fflush(fileout);
+#ifdef __WXMSW__
+ _commit(_fileno(fileout));
+#else
+ fsync(fileno(fileout));
+#endif
+
return true;
}
|