From 674f52fdb4ee29df88c8b4e20e0edfb5d5ba3138 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 16 Sep 2014 21:54:07 +0100 Subject: [PATCH] Silence some clang warnings --- libraries/liblmdb/mdb_dump.c | 4 ++++ libraries/liblmdb/mdb_load.c | 6 ++++-- libraries/liblmdb/mdb_stat.c | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libraries/liblmdb/mdb_dump.c b/libraries/liblmdb/mdb_dump.c index 3b01f96..0eb85fd 100644 --- a/libraries/liblmdb/mdb_dump.c +++ b/libraries/liblmdb/mdb_dump.c @@ -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); diff --git a/libraries/liblmdb/mdb_load.c b/libraries/liblmdb/mdb_load.c index 268fe0d..e0d95e1 100644 --- a/libraries/liblmdb/mdb_load.c +++ b/libraries/liblmdb/mdb_load.c @@ -64,8 +64,6 @@ flagbit dbflags[] = { { 0, NULL, 0 } }; -static const char hexc[] = "0123456789abcdef"; - static void readhdr(void) { char *ptr; @@ -345,6 +343,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; + } mdb_env_set_maxdbs(env, 2); diff --git a/libraries/liblmdb/mdb_stat.c b/libraries/liblmdb/mdb_stat.c index 25c092c..1e92292 100644 --- a/libraries/liblmdb/mdb_stat.c +++ b/libraries/liblmdb/mdb_stat.c @@ -105,6 +105,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, 4); @@ -117,8 +121,8 @@ int main(int argc, char *argv[]) } if (envinfo) { - rc = mdb_env_stat(env, &mst); - rc = mdb_env_info(env, &mei); + (void)mdb_env_stat(env, &mst); + (void)mdb_env_info(env, &mei); printf("Environment Info\n"); printf(" Map address: %p\n", mei.me_mapaddr); printf(" Map size: %"Z"u\n", mei.me_mapsize);