memcapable: fix test for 1.6
[m6w6/libmemcached] / src / bin / memstat.cc
index e5bac9165a26d171734b690589a110d334c17129..48ba3b6a9088274b57947ac18a55d773df7654df 100644 (file)
@@ -12,7 +12,7 @@
  *          Brian Aker
  *          Toru Maesaka
  */
-#include <mem_config.h>
+#include "mem_config.h"
 
 #include <cstdio>
 #include <cstring>
@@ -26,7 +26,7 @@
 #include <sys/types.h>
 #include <sys/types.h>
 
-#include <libmemcached-1.0/memcached.h>
+#include "libmemcached-1.0/memcached.h"
 
 #include "client_options.h"
 #include "utilities.h"
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
   {
     if (memcached_failed(memcached_version(memc)))
     {
-      std::cerr << "Unable to obtain server version";
+      std::cerr << "Unable to obtain server version" << std::endl;
       exit(EXIT_FAILURE);
     }
 
@@ -179,8 +179,9 @@ int main(int argc, char *argv[])
   {
     memcached_stat_st *memc_stat= memcached_stat(memc, NULL, &rc);
 
-    if (memc_stat == NULL)
+    if (memc_stat == NULL || rc != MEMCACHED_SUCCESS)
     {
+      std::cerr << memcached_last_error_message(memc) << std::endl;
       exit(EXIT_FAILURE);
     }