diff --git a/util/file.h b/util/file.h index 7a47be95a8d..38eef8ab3b3 100644 --- a/util/file.h +++ b/util/file.h @@ -72,7 +72,7 @@ public: void open(const char *filename, bool readOnly=false ) { fd = CreateFile( toNativeString(filename).c_str(), - ( readOnly ? 0 : GENERIC_WRITE ) | GENERIC_READ, FILE_SHARE_READ, + ( readOnly ? 0 : GENERIC_WRITE ) | GENERIC_READ, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if( !is_open() ) { DWORD e = GetLastError(); diff --git a/util/mmap_win.cpp b/util/mmap_win.cpp index e69b50b3582..d7b17fc78a9 100644 --- a/util/mmap_win.cpp +++ b/util/mmap_win.cpp @@ -113,7 +113,7 @@ namespace mongo { fd = CreateFile( toNativeString(filename).c_str(), rw, // desired access - FILE_SHARE_READ, // share mode + FILE_SHARE_WRITE | FILE_SHARE_READ, // share mode NULL, // security OPEN_ALWAYS, // create disposition createOptions , // flags