X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=libmemcached%2Fauto.c;h=fde81d47e3da67ceb19265a2d42cb1f203fee8e0;hb=f9f501287ffa6a2c69a9033536d3b6f14db34204;hp=c36cd92f4c969ccf0508f89b19d09a75093a1596;hpb=04ef974c23973986d4475e3cb8a876012264e2da;p=awesomized%2Flibmemcached diff --git a/libmemcached/auto.c b/libmemcached/auto.c index c36cd92f..fde81d47 100644 --- a/libmemcached/auto.c +++ b/libmemcached/auto.c @@ -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)