diff options
-rw-r--r-- | util/mmap_win.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/util/mmap_win.cpp b/util/mmap_win.cpp index bbb7d873986..6f7fd803310 100644 --- a/util/mmap_win.cpp +++ b/util/mmap_win.cpp @@ -100,21 +100,20 @@ namespace mongo { } void MemoryMappedFile::flush(bool sync) { + uassert(13056, "Async flushing not supported on windows", sync); + if (!view) return; - // Note: this is blocking and ignores sync bool success = FlushViewOfFile(view, 0); // 0 means whole mapping if (!success){ int err = GetLastError(); - out() << "FlushViewOfFile failed " << err << " " << endl; + out() << "FlushViewOfFile failed " << err << endl; } - if (sync){ - bool success = FlushFileBuffers(fd); - if (!success){ - int err = GetLastError(); - out() << "FlushFileBuffers failed " << err << " " << endl; - } + success = FlushFileBuffers(fd); + if (!success){ + int err = GetLastError(); + out() << "FlushFileBuffers failed " << err << endl; } } } |