summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/init.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-21 17:47:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-21 17:47:28 +0000
commit00a8ec3be1ebc0367e6725f93833bd53323ffae5 (patch)
tree1eebc55aaa1ae5374afe791a082056bfa999141f /plugins/Db3x_mmap/src/init.cpp
parent099decfc4c419bb0b12a2b1c4c285c0ef1568430 (diff)
fix for running dbchecker over the locked profile
git-svn-id: http://svn.miranda-ng.org/main/trunk@8673 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/init.cpp')
-rw-r--r--plugins/Db3x_mmap/src/init.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp
index d283f944cb..928ec0739f 100644
--- a/plugins/Db3x_mmap/src/init.cpp
+++ b/plugins/Db3x_mmap/src/init.cpp
@@ -49,7 +49,7 @@ LIST<CDb3Mmap> g_Dbs(1, HandleKeySortT);
// returns 0 if the profile is created, EMKPRF*
static int makeDatabase(const TCHAR *profile)
{
- std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, false));
+ std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, 0));
if (db->Create() != ERROR_SUCCESS)
return EMKPRF_CREATEFAILED;
@@ -59,7 +59,7 @@ static int makeDatabase(const TCHAR *profile)
// returns 0 if the given profile has a valid header
static int grokHeader(const TCHAR *profile)
{
- std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, true));
+ std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_SHARED | DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS)
return EGROKPRF_CANTREAD;
@@ -72,7 +72,7 @@ static MIDatabase* LoadDatabase(const TCHAR *profile, BOOL bReadOnly)
// set the memory, lists & UTF8 manager
mir_getLP(&pluginInfo);
- std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, bReadOnly != 0));
+ std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, (bReadOnly) ? DBMODE_READONLY : 0));
if (db->Load(false) != ERROR_SUCCESS)
return NULL;
@@ -89,9 +89,9 @@ static int UnloadDatabase(MIDatabase *db)
MIDatabaseChecker* CheckDb(const TCHAR *profile, int *error)
{
- std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, true));
+ std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS) {
- *error = EGROKPRF_CANTREAD;
+ *error = ERROR_ACCESS_DENIED;
return NULL;
}