From: Brian Aker Date: Sat, 29 Sep 2007 00:16:04 +0000 (-0700) Subject: Fix failing issue in memstat X-Git-Tag: 0.3~13 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=246060cb7056a0aced6f164faaa1f16b8cf90ccf;p=m6w6%2Flibmemcached Fix failing issue in memstat --- diff --git a/lib/libmemcached_probes.h b/lib/libmemcached_probes.h index ba563ac2..cf59cc59 100644 --- a/lib/libmemcached_probes.h +++ b/lib/libmemcached_probes.h @@ -13,8 +13,6 @@ extern "C" { #if _DTRACE_VERSION -#warning "Trying to BUILD WITH DTRACE!!!!" - #define LIBMEMCACHED_MEMCACHED_ADD_END() \ __dtrace_libmemcached___memcached_add_end() #define LIBMEMCACHED_MEMCACHED_ADD_END_ENABLED() \ diff --git a/src/memstat.c b/src/memstat.c index d6e31507..bc81cb07 100644 --- a/src/memstat.c +++ b/src/memstat.c @@ -35,6 +35,13 @@ int main(int argc, char *argv[]) parse_opt_servers(memc, opt_servers); stat= memcached_stat(memc, NULL, &rc); + if (rc != MEMCACHED_SUCCESS || rc != MEMCACHED_SOME_ERRORS); + { + printf("Failure to communicate with servers (%s)\n", + memcached_strerror(memc, rc)); + exit(1); + } + server_list= memcached_server_list(memc); printf("Listing %u Server\n\n", memcached_server_count(memc)); @@ -44,6 +51,7 @@ int main(int argc, char *argv[]) char **ptr; list= memcached_stat_get_keys(memc, &stat[x], &rc); + assert(list); assert(rc == MEMCACHED_SUCCESS); printf("Server: %s (%u)\n", memcached_server_name(memc, server_list[x]),