int rc = 0;
if (env->me_flags & MDB_RDONLY)
return EACCES;
- if (force
-#ifndef _WIN32 /* Sync is normally achieved in Windows by doing WRITE_THROUGH writes */
- || !(env->me_flags & MDB_NOSYNC)
+ if (force || !(env->me_flags & MDB_NOSYNC)
+#ifdef _WIN32 /* Sync is normally achieved in Windows by doing WRITE_THROUGH writes */
+ && (env->me_flags & MDB_WRITEMAP)
#endif
) {
if (env->me_flags & MDB_WRITEMAP) {
j = i = keep;
- if (env->me_flags & MDB_WRITEMAP
-#ifdef _WIN32
- /* In windows, we still do writes to the file (with write-through enabled in sync mode),
- * as this is faster than FlushViewOfFile/FlushFileBuffers */
- && (env->me_flags & MDB_NOSYNC)
-#endif
- ) {
+ if (env->me_flags & MDB_WRITEMAP) {
goto done;
}