summaryrefslogtreecommitdiff
path: root/tools/mdbx_dump/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-10-04 17:35:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-10-04 17:35:32 +0300
commit46fa8c36208281ab2ca0b35d9df966d1b836c592 (patch)
tree5d646020a0ddac4a23895c06fc01e01466f159b0 /tools/mdbx_dump/src
parentbc90398de24d738ce4ebfb74021b508f7477d685 (diff)
fixme.cmd - a batch file to extract as much data as possible from the broken profile
Diffstat (limited to 'tools/mdbx_dump/src')
-rw-r--r--tools/mdbx_dump/src/mdbx_dump.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/mdbx_dump/src/mdbx_dump.cc b/tools/mdbx_dump/src/mdbx_dump.cc
index 989c7a0d24..e1c0b45e77 100644
--- a/tools/mdbx_dump/src/mdbx_dump.cc
+++ b/tools/mdbx_dump/src/mdbx_dump.cc
@@ -251,7 +251,7 @@ int main(int argc, char *argv[]) {
mdbx_env_set_maxdbs(env, 2);
}
- rc = mdbx_env_open(env, envname, envflags | MDBX_RDONLY, 0664);
+ rc = mdbx_env_open(env, envname, envflags | MDBX_EXCLUSIVE | MDBX_RDONLY, 0664);
if (rc) {
fprintf(stderr, "mdbx_env_open failed, error %d %s\n", rc,
mdbx_strerror(rc));
@@ -323,8 +323,12 @@ int main(int argc, char *argv[]) {
} else {
rc = dumpit(txn, dbi, subname);
}
- if (rc && rc != MDBX_NOTFOUND)
- fprintf(stderr, "%s: %s: %s\n", prog, envname, mdbx_strerror(rc));
+ if (rc) {
+ if (rc != MDBX_NOTFOUND)
+ fprintf(stderr, "%s: %s: %s\n", prog, envname, mdbx_strerror(rc));
+ else
+ rc = 0;
+ }
mdbx_dbi_close(env, dbi);
txn_abort: