aboutsummaryrefslogtreecommitdiff
path: root/external/db_drivers/liblmdb/mdb_dump.c
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2017-08-12 12:21:25 +0100
committerHoward Chu <hyc@symas.com>2017-08-12 12:21:25 +0100
commit9c6eb75c656363176a55c63c81803feb3cfa614d (patch)
treeb46956d659a9047b4d0730081fff4ca3cd6c3ca8 /external/db_drivers/liblmdb/mdb_dump.c
parentMerge pull request #2263 (diff)
downloadmonero-9c6eb75c656363176a55c63c81803feb3cfa614d.tar.xz
ITS#8704 add MDB_PREVSNAPSHOT flag to mdb_env_open
used to open the previous snapshot, in case the latest one is corrupted
Diffstat (limited to 'external/db_drivers/liblmdb/mdb_dump.c')
-rw-r--r--external/db_drivers/liblmdb/mdb_dump.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/external/db_drivers/liblmdb/mdb_dump.c b/external/db_drivers/liblmdb/mdb_dump.c
index 72a469052..7a42bc0b6 100644
--- a/external/db_drivers/liblmdb/mdb_dump.c
+++ b/external/db_drivers/liblmdb/mdb_dump.c
@@ -164,7 +164,7 @@ static int dumpit(MDB_txn *txn, MDB_dbi dbi, char *name)
static void usage(char *prog)
{
- fprintf(stderr, "usage: %s [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb] dbpath\n", prog);
+ fprintf(stderr, "usage: %s [-V] [-f output] [-l] [-n] [-p] [-v] [-a|-s subdb] dbpath\n", prog);
exit(EXIT_FAILURE);
}
@@ -188,6 +188,7 @@ int main(int argc, char *argv[])
* -n: use NOSUBDIR flag on env_open
* -p: use printable characters
* -f: write to file instead of stdout
+ * -v: use previous snapshot
* -V: print version and exit
* (default) dump only the main DB
*/
@@ -215,6 +216,9 @@ int main(int argc, char *argv[])
case 'n':
envflags |= MDB_NOSUBDIR;
break;
+ case 'v':
+ envflags |= MDB_PREVSNAPSHOT;
+ break;
case 'p':
mode |= PRINT;
break;