summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/init.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-26 15:22:35 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-26 15:22:35 +0000
commitd0580040b51b6c4803e0f61863bd985c382370e9 (patch)
treefb9816ee0b889ec88694fbca29d7b2056320a3dc /plugins/Db3x_mmap/src/init.cpp
parent1fb07e640abb626418980d241148b3fcba90998d (diff)
fix for creating backup files in dbchecker
git-svn-id: http://svn.miranda-ng.org/main/trunk@7906 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, 3 insertions, 7 deletions
diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp
index 4938ae9cba..e9810fabe4 100644
--- a/plugins/Db3x_mmap/src/init.cpp
+++ b/plugins/Db3x_mmap/src/init.cpp
@@ -72,7 +72,7 @@ static MIDatabase* LoadDatabase(const TCHAR *profile)
// set the memory, lists & UTF8 manager
mir_getLP( &pluginInfo );
- std::auto_ptr<CDb3Mmap> db( new CDb3Mmap(profile));
+ std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile));
if (db->Load(false) != ERROR_SUCCESS)
return NULL;
@@ -90,18 +90,14 @@ static int UnloadDatabase(MIDatabase* db)
MIDatabaseChecker* CheckDb(const TCHAR* profile, int *error)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile));
- if (db->Load(false) != ERROR_SUCCESS) {
+ if (db->Load(true) != ERROR_SUCCESS) {
*error = EGROKPRF_CANTREAD;
return NULL;
}
- int chk = db->CheckDbHeaders();
- if (chk != ERROR_SUCCESS) {
- *error = chk;
+ if (*error = db->PrepareCheck())
return NULL;
- }
- *error = 0;
return db.release();
}