Fix for non-Linux platforms.
[m6w6/libmemcached] / libmemcached / stats.c
index a47b28205623d46061ad77fbf994b4ca76e1167a..1f3ca5bf8700db57a0de8a1111df784a28de8c8a 100644 (file)
@@ -151,7 +151,8 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, char *key, char
              strcmp("listen_disabled_num", key) == 0 ||
              strcmp("conn_yields", key) == 0 ||
              strcmp("auth_cmds", key) == 0 ||
-             strcmp("auth_errors", key) == 0))
+             strcmp("auth_errors", key) == 0 ||
+             strcmp("reclaimed", key) == 0))
   {
     WATCHPOINT_STRING(key);
     return MEMCACHED_UNKNOWN_STAT_KEY;
@@ -250,8 +251,8 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat,
     request.message.header.request.bodylen= htonl((uint32_t) len);
 
     if ((memcached_do(instance, request.bytes,
-                      sizeof(request.bytes), 0) != MEMCACHED_SUCCESS) ||
-        (memcached_io_write(instance, args, len, 1) == -1))
+                      sizeof(request.bytes), false) != MEMCACHED_SUCCESS) ||
+        (memcached_io_write(instance, args, len, true) == -1))
     {
       memcached_io_reset(instance);
       return MEMCACHED_WRITE_FAILURE;
@@ -260,7 +261,7 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat,
   else
   {
     if (memcached_do(instance, request.bytes,
-                     sizeof(request.bytes), 1) != MEMCACHED_SUCCESS)
+                     sizeof(request.bytes), true) != MEMCACHED_SUCCESS)
     {
       memcached_io_reset(instance);
       return MEMCACHED_WRITE_FAILURE;
@@ -314,7 +315,7 @@ static memcached_return_t ascii_stats_fetch(memcached_stat_st *memc_stat,
   if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
     return MEMCACHED_WRITE_FAILURE;
 
-  rc= memcached_do(instance, buffer, send_length, 1);
+  rc= memcached_do(instance, buffer, send_length, true);
   if (rc != MEMCACHED_SUCCESS)
     goto error;
 
@@ -444,12 +445,11 @@ char ** memcached_stat_get_keys(memcached_st *ptr,
   char **list;
   size_t length= sizeof(memcached_stat_keys);
 
-  list= libmemcached_malloc(memc_stat && memc_stat->root
-                            ? memc_stat->root
-                            : ptr,
-                            length);
+  (void)memc_stat;
 
-  if (!list)
+  list= libmemcached_malloc(ptr, length);
+
+  if (! list)
   {
     *error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
     return NULL;