Merge in updates to make sure exit/return is done properly.
[awesomized/libmemcached] / libhashkit / ketama.c
index e56594cf7bff5411be46b0f07dab2ad866705645..560de30031ccc329a5afcc4a3b238e3da4fb3a96 100644 (file)
@@ -7,7 +7,9 @@
  */
 
 #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];
@@ -25,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;
 }
@@ -69,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)
   {
@@ -157,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