0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

fix sharing violation on windows

This commit is contained in:
Mathias Stearn 2010-12-22 18:01:30 -05:00
parent a1c70486b9
commit 0c14ad831c
2 changed files with 2 additions and 2 deletions

View File

@ -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();

View File

@ -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