mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
fsync shouldn't be a noop on windows SERVER-728
This commit is contained in:
parent
9172d692cd
commit
ae02e61015
@ -99,7 +99,22 @@ namespace mongo {
|
||||
return view;
|
||||
}
|
||||
|
||||
void MemoryMappedFile::flush(bool) {
|
||||
}
|
||||
void MemoryMappedFile::flush(bool 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;
|
||||
}
|
||||
|
||||
if (sync){
|
||||
bool success = FlushFileBuffers(fd);
|
||||
if (!success){
|
||||
int err = GetLastError();
|
||||
out() << "FlushFileBuffers failed " << err << " " << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user