From 46fa8c36208281ab2ca0b35d9df966d1b836c592 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Oct 2018 17:35:32 +0300 Subject: fixme.cmd - a batch file to extract as much data as possible from the broken profile --- tools/mdbx_dump/src/mdbx_dump.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/mdbx_dump') 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: -- cgit v1.2.3