diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-26 00:01:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-26 00:01:31 +0300 |
commit | b2c47fe47b18d21b90d9c536e70bf45ef9d33e3c (patch) | |
tree | 99abc6383f38e168f768daabbe49ac2c17c7d1a7 /plugins | |
parent | 6e0d30721924f58ecbcd73d9bc53a8940ba0133a (diff) |
fixes #1208 (if profile is opened in r/w mode, it should be locked)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Dbx_mdbx/src/dbintf.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp index 5ecac705be..ee0c7b8e3c 100644 --- a/plugins/Dbx_mdbx/src/dbintf.cpp +++ b/plugins/Dbx_mdbx/src/dbintf.cpp @@ -194,5 +194,7 @@ int CDbxMDBX::Map() unsigned int mode = MDBX_NOSUBDIR | MDBX_MAPASYNC | MDBX_WRITEMAP | MDBX_NOSYNC;
if (m_bReadOnly)
mode |= MDBX_RDONLY;
- return mdbx_env_open(m_env, _T2A(m_tszProfileName), mode, 0664);
+
+ int exclusive = (m_bShared) ? 1 : 2;
+ return mdbx_env_open_ex(m_env, _T2A(m_tszProfileName), mode, 0664, &exclusive);
}
|