Fix build for non-sasl-enabled builds
[awesomized/libmemcached] / libmemcached / auto.c
index c36cd92f4c969ccf0508f89b19d09a75093a1596..fde81d47e3da67ceb19265a2d42cb1f203fee8e0 100644 (file)
@@ -111,12 +111,13 @@ static memcached_return_t binary_incr_decr(memcached_st *ptr, uint8_t cmd,
   request.message.body.initial= htonll(initial);
   request.message.body.expiration= htonl((uint32_t) expiration);
 
-  if ((memcached_do(instance, request.bytes,
-                    sizeof(request.bytes), false) != MEMCACHED_SUCCESS) ||
+  memcached_return_t rc;
+  if (((rc= memcached_do(instance, request.bytes,
+                         sizeof(request.bytes), false)) != MEMCACHED_SUCCESS) ||
       (memcached_io_write(instance, key, key_length, true) == -1))
   {
     memcached_io_reset(instance);
-    return MEMCACHED_WRITE_FAILURE;
+    return (rc == MEMCACHED_SUCCESS) ? MEMCACHED_WRITE_FAILURE : rc;
   }
 
   if (no_reply)