- return (status);
-} /* }}} */
-
-static redis_node_t *redis_node_get (const char *name, redis_node_t *rn) /* {{{ */
-{
- if (c_avl_get (redis_tree, name, (void *) rn) == 0)
- return (rn);
- else
- return (NULL);
-} /* }}} */
-
-static int redis_node_add (const redis_node_t *rn) /* {{{ */
-{
- int status;
- redis_node_t *rn_copy = NULL;
- redis_node_t *rn_ptr;
- redis_node_t rn_get;
-
- rn_copy = (redis_node_t *) malloc (sizeof (redis_node_t));
- if (rn_copy == NULL)
- {
- sfree (rn_copy);
- ERROR ("redis plugin: malloc failed adding redis_node to the tree.");
- return (-1);
- }
- memcpy (rn_copy, rn, sizeof (redis_node_t));
- if (*rn_copy->name == '\0')
- {
- (void) strncpy(rn_copy->name, "default", sizeof (rn_copy->name)); /* in theory never fails */
- }
-
- DEBUG ("redis plugin: adding entry `%s' to the tree.", rn_copy->name);
-
- pthread_mutex_lock (&redis_lock);
-
- if ( (rn_ptr = redis_node_get (rn_copy->name, &rn_get)) != NULL )
- {
- WARNING ("redis plugin: the node `%s' override a previous node with same node.", rn_copy->name);
- }
-
- status = c_avl_insert (redis_tree, rn_copy->name, rn_copy);
- pthread_mutex_unlock (&redis_lock);
-