Disable SO_SNDTIMEO and SO_RCVTIMEO on Solaris
[awesomized/libmemcached] / libmemcached / memcached_do.c
index c4bf574f641d8a28d36ce649db884bc20d913c74..f788582f8d54c91a6996c07b4fd9bcfca367edfc 100644 (file)
@@ -1,6 +1,6 @@
 #include "common.h"
 
-memcached_return memcached_do(memcached_server_st *ptr, char *command, 
+memcached_return memcached_do(memcached_server_st *ptr, const void *command, 
                               size_t command_length, uint8_t with_flush)
 {
   memcached_return rc;
@@ -10,11 +10,14 @@ memcached_return memcached_do(memcached_server_st *ptr, char *command,
   WATCHPOINT_ASSERT(command);
 
   if ((rc= memcached_connect(ptr)) != MEMCACHED_SUCCESS)
+  {
+    WATCHPOINT_ERROR(rc);
     return rc;
+  }
 
   sent_length= memcached_io_write(ptr, command, command_length, with_flush);
 
-  if (sent_length == -1 || sent_length != command_length)
+  if (sent_length == -1 || (size_t)sent_length != command_length)
     rc= MEMCACHED_WRITE_FAILURE;
   else
     memcached_server_response_increment(ptr);