Big fix for async mode to make sure all data has been pushed through socket
[awesomized/libmemcached] / src / memstat.c
index 40aade209435daa74e62e3845d5948e6b3cbf4eb..6f3c55d80fee6dffa79c6e283090b01cc5537cce 100644 (file)
@@ -4,6 +4,8 @@
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <fcntl.h>
+#include <string.h>
+#include <assert.h>
 #include <getopt.h>
 
 #include <memcached.h>
@@ -50,7 +52,7 @@ int main(int argc, char *argv[])
 
   stat= memcached_stat(memc, NULL, &rc);
 
-  if (rc != MEMCACHED_SUCCESS && rc == MEMCACHED_SOME_ERRORS)
+  if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_SOME_ERRORS)
   {
     printf("Failure to communicate with servers (%s)\n",
           memcached_strerror(memc, rc));