]> git.sur5r.net Git - openldap/blobdiff - libraries/liblmdb/mdb_dump.c
Merge remote-tracking branch 'origin/mdb.RE/0.9'
[openldap] / libraries / liblmdb / mdb_dump.c
index 3b01f9643d637910a1cb651889b392c3772db417..16c0aae1b734e2065f99d2c86c30d457e57217cb 100644 (file)
@@ -1,6 +1,6 @@
 /* mdb_dump.c - memory-mapped database dump tool */
 /*
- * Copyright 2011-2014 Howard Chu, Symas Corp.
+ * Copyright 2011-2015 Howard Chu, Symas Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -155,7 +155,7 @@ static int dumpit(MDB_txn *txn, MDB_dbi dbi, char *name)
 
 static void usage(char *prog)
 {
-       fprintf(stderr, "usage: %s dbpath [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb]\n", prog);
+       fprintf(stderr, "usage: %s [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb] dbpath\n", prog);
        exit(EXIT_FAILURE);
 }
 
@@ -233,6 +233,10 @@ int main(int argc, char *argv[])
 
        envname = argv[optind];
        rc = mdb_env_create(&env);
+       if (rc) {
+               fprintf(stderr, "mdb_env_create failed, error %d %s\n", rc, mdb_strerror(rc));
+               return EXIT_FAILURE;
+       }
 
        if (alldbs || subname) {
                mdb_env_set_maxdbs(env, 2);