From b2c47fe47b18d21b90d9c536e70bf45ef9d33e3c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Mar 2018 00:01:31 +0300 Subject: fixes #1208 (if profile is opened in r/w mode, it should be locked) --- plugins/Dbx_mdbx/src/dbintf.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/Dbx_mdbx/src') 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); } -- cgit v1.2.3