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:
parent
a1c70486b9
commit
0c14ad831c
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user