summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-26 00:01:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-26 00:01:31 +0300
commitb2c47fe47b18d21b90d9c536e70bf45ef9d33e3c (patch)
tree99abc6383f38e168f768daabbe49ac2c17c7d1a7 /plugins
parent6e0d30721924f58ecbcd73d9bc53a8940ba0133a (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.cpp4
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);
}