summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-07 12:16:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-07 12:16:09 +0300
commitaa859cd9b0034a3e54e422868018e1714b743156 (patch)
tree293a305bbde5308a510970e51d5d3013c98cd595
parent76369b058c5a5123fdb7758df7e9635377dc76cc (diff)
merge of fix into libdbmx that could create broken profiles
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp4
-rw-r--r--plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c6
-rw-r--r--plugins/Dbx_mdbx/src/libmdbx/src/osal.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp
index a293b2f84a..9c659c5593 100644
--- a/plugins/Dbx_mdbx/src/dbintf.cpp
+++ b/plugins/Dbx_mdbx/src/dbintf.cpp
@@ -183,7 +183,7 @@ BOOL CDbxMDBX::Compact()
}
mir_cslock lck(m_csDbAccess);
- int res = mdbx_env_copy2fd(m_env, pFile, /*MDBX_CP_COMPACT*/0);
+ int res = mdbx_env_copy2fd(m_env, pFile, MDBX_CP_COMPACT);
CloseHandle(pFile);
if (res == MDBX_SUCCESS) {
@@ -208,7 +208,7 @@ BOOL CDbxMDBX::Backup(const wchar_t *pwszPath)
return 1;
}
- int res = mdbx_env_copy2fd(m_env, pFile, 0);
+ int res = mdbx_env_copy2fd(m_env, pFile, MDBX_CP_COMPACT);
CloseHandle(pFile);
if (res == MDBX_SUCCESS)
return 0;
diff --git a/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c b/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c
index 042d6079d4..ad55a98f81 100644
--- a/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c
+++ b/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c
@@ -5793,7 +5793,7 @@ int __cold mdbx_env_open(MDBX_env *env, const char *path, unsigned flags,
}
const uint32_t saved_me_flags = env->me_flags;
- env->me_flags = flags | MDBX_ENV_ACTIVE;
+ env->me_flags = (flags & ~MDBX_FATAL_ERROR) | MDBX_ENV_ACTIVE;
if (rc)
goto bailout;
@@ -5915,7 +5915,7 @@ int __cold mdbx_env_open(MDBX_env *env, const char *path, unsigned flags,
bailout:
if (rc) {
mdbx_env_close0(env);
- env->me_flags = saved_me_flags;
+ env->me_flags = saved_me_flags | MDBX_FATAL_ERROR;
}
free(lck_pathname);
return rc;
@@ -10448,8 +10448,8 @@ static int __cold mdbx_env_compact(MDBX_env *env, mdbx_filehandle_t fd) {
/* update signature */
meta->mp_meta.mm_datasync_sign = mdbx_meta_sign(&meta->mp_meta);
+ memcpy(ctx.mc_wbuf[0], buffer, ctx.mc_wlen[0] = pgno2bytes(env, NUM_METAS));
- ctx.mc_wlen[0] = pgno2bytes(env, NUM_METAS);
ctx.mc_txn = txn;
rc = mdbx_env_cwalk(&ctx, &root, 0);
if (rc == MDBX_SUCCESS && root != new_root) {
diff --git a/plugins/Dbx_mdbx/src/libmdbx/src/osal.c b/plugins/Dbx_mdbx/src/libmdbx/src/osal.c
index 159fba965d..738a179465 100644
--- a/plugins/Dbx_mdbx/src/libmdbx/src/osal.c
+++ b/plugins/Dbx_mdbx/src/libmdbx/src/osal.c
@@ -191,7 +191,7 @@ __cold void mdbx_panic(const char *fmt, ...) {
abort();
}
- /*----------------------------------------------------------------------------*/
+/*----------------------------------------------------------------------------*/
#ifndef mdbx_asprintf
int mdbx_asprintf(char **strp, const char *fmt, ...) {