Merge in updates to make sure exit/return is done properly.
[awesomized/libmemcached] / libhashkit / ketama.c
index 502b1c74ed405325cf4cd3013e9d549cb59a3adf..560de30031ccc329a5afcc4a3b238e3da4fb3a96 100644 (file)
@@ -6,9 +6,10 @@
  * the COPYING file in the parent directory for full text.
  */
 
-#include <math.h>
 #include "common.h"
+#include <math.h>
 
+#if 0
 static uint32_t ketama_server_hash(const char *key, unsigned int key_length, int alignment)
 {
   unsigned char results[16];
@@ -26,9 +27,9 @@ static int continuum_points_cmp(const void *t1, const void *t2)
   hashkit_continuum_point_st *ct2= (hashkit_continuum_point_st *)t2;
 
   if (ct1->value == ct2->value)
-    return 0;
+    return EXIT_SUCCESS;
   else if (ct1->value > ct2->value)
-    return 1;
+    return EXIT_FAILURE;
   else
     return -1;
 }
@@ -70,7 +71,7 @@ int update_continuum(hashkit_st *hashkit)
     live_servers= (uint32_t)hashkit->list_size;
 
   if (live_servers == 0)
-    return 0;
+    return EXIT_SUCCESS;
 
   if (hashkit->weight_fn == NULL)
   {
@@ -158,5 +159,6 @@ int update_continuum(hashkit_st *hashkit)
   qsort(hashkit->continuum, hashkit->continuum_points_count, sizeof(hashkit_continuum_point_st),
         continuum_points_cmp);
 
-  return 0;
+  return EXIT_SUCCESS;
 }
+#endif