src/utils_avltree.[ch]: Change avl_insert to return >0 if the key is already in the...
[collectd.git] / src / utils_avltree.c
index 786bc38..031ec47 100644 (file)
@@ -19,6 +19,9 @@
  * Authors:
  *   Florian octo Forster <octo at verplant.org>
  **/
+
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -515,7 +518,7 @@ int avl_insert (avl_tree_t *t, void *key, void *value)
                if (cmp == 0)
                {
                        free_node (new);
-                       return (-1);
+                       return (1);
                }
                else if (cmp < 0)
                {