#include "plugin.h"
#include "common.h"
-#include "configfile.h"
#include <sys/time.h>
#include <hiredis/hiredis.h>
node->conn = redisConnectWithTimeout ((char *)node->host, node->port, node->timeout);
if (node->conn == NULL)
{
- ERROR ("write_redis plugin: Connecting to host \"%s\" (port %i) failed: Unkown reason",
+ ERROR ("write_redis plugin: Connecting to host \"%s\" (port %i) failed: Unknown reason",
(node->host != NULL) ? node->host : "localhost",
(node->port != 0) ? node->port : 6379);
pthread_mutex_unlock (&node->lock);
if (status == 0)
{
char cb_name[DATA_MAX_NAME_LEN];
- user_data_t ud;
ssnprintf (cb_name, sizeof (cb_name), "write_redis/%s", node->name);
- ud.data = node;
- ud.free_func = wr_config_free;
+ user_data_t ud = {
+ .data = node,
+ .free_func = wr_config_free
+ };
status = plugin_register_write (cb_name, wr_write, &ud);
}