Fix for most errors around non-block
[awesomized/libmemcached] / libmemcached / memcached_do.c
index 7b9da5ed437ed3e38aa0d06d49145aaca0f9e010..f788582f8d54c91a6996c07b4fd9bcfca367edfc 100644 (file)
@@ -10,11 +10,14 @@ memcached_return memcached_do(memcached_server_st *ptr, const void *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);