Fix all include location, and drop versions of the library that were never shipped.
[awesomized/libmemcached] / clients / execute.cc
index b276954533e1b119375cd3aba183886dfbf30d21..cf7779e5140c8f2afada67ebc5c1ab8c81e8d45d 100644 (file)
@@ -1,4 +1,5 @@
 /* LibMemcached
+ * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
  * Copyright (C) 2006-2009 Brian Aker
  * All rights reserved.
  *
@@ -27,7 +28,7 @@ unsigned int execute_set(memcached_st *memc, pairs_st *pairs, unsigned int numbe
     memcached_return_t rc= memcached_set(memc, pairs[x].key, pairs[x].key_length,
                                          pairs[x].value, pairs[x].value_length,
                                          0, 0);
-    if (rc != MEMCACHED_SUCCESS and rc != MEMCACHED_BUFFERED)
+    if (memcached_failed(rc))
     {
       fprintf(stderr, "%s:%d Failure on insert (%s) of %.*s\n",
               __FILE__, __LINE__,
@@ -52,7 +53,6 @@ unsigned int execute_set(memcached_st *memc, pairs_st *pairs, unsigned int numbe
 */
 unsigned int execute_get(memcached_st *memc, pairs_st *pairs, unsigned int number_of)
 {
-  memcached_return_t rc;
   unsigned int x;
   unsigned int retrieved;
 
@@ -64,10 +64,11 @@ unsigned int execute_get(memcached_st *memc, pairs_st *pairs, unsigned int numbe
 
     unsigned int fetch_key= (unsigned int)((unsigned int)random() % number_of);
 
+    memcached_return_t rc;
     char *value= memcached_get(memc, pairs[fetch_key].key, pairs[fetch_key].key_length,
                                &value_length, &flags, &rc);
 
-    if (rc != MEMCACHED_SUCCESS)
+    if (memcached_failed(rc))
     {
       fprintf(stderr, "%s:%d Failure on read(%s) of %.*s\n",
               __FILE__, __LINE__,