DTrace support
[m6w6/libmemcached] / lib / memcached_stats.c
index ed2c0e20ffc2d4d7577ae57184eeb3b13e89f236..1e3c425b0df693e27180a7335e1cd50f4e0cdcab 100644 (file)
@@ -1,7 +1,7 @@
 /*
 */
 
-#include <memcached.h>
+#include "common.h"
 
 static char *memcached_stat_keys[] = {
   "pid",
@@ -240,7 +240,7 @@ static memcached_return memcached_stats_fetch(memcached_st *ptr,
   if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
     return MEMCACHED_WRITE_FAILURE;
 
-  sent_length= write(ptr->hosts[server_key].fd, buffer, send_length);
+  sent_length= send(ptr->hosts[server_key].fd, buffer, send_length, 0);
 
   if (sent_length == -1 || sent_length != send_length)
     return MEMCACHED_WRITE_FAILURE;
@@ -338,6 +338,8 @@ char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat,
 {
   char **list= (char **)malloc(sizeof(memcached_stat_keys));
 
+  memset(list, 0, sizeof(memcached_stat_keys));
+
   if (!list)
   {
     *error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;