X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_redis.c;h=324999c16fbd077f640c3080ee1f5fd8fe1968e7;hb=25824c65721f0f21cadf1607fad367c7e7831816;hp=c17654b464d763fc9b6938a9a2da21e81b9ed2c4;hpb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;p=collectd.git diff --git a/src/write_redis.c b/src/write_redis.c index c17654b4..324999c1 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -26,8 +26,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include #include @@ -184,8 +184,8 @@ static int wr_config_node(oconfig_item_t *ci) /* {{{ */ return ENOMEM; node->host = NULL; node->port = 0; - node->timeout.tv_sec = 0; - node->timeout.tv_usec = 1000; + node->timeout.tv_sec = 1; + node->timeout.tv_usec = 0; node->conn = NULL; node->prefix = NULL; node->database = 0; @@ -213,8 +213,11 @@ static int wr_config_node(oconfig_item_t *ci) /* {{{ */ } } else if (strcasecmp("Timeout", child->key) == 0) { status = cf_util_get_int(child, &timeout); - if (status == 0) - node->timeout.tv_usec = timeout; + if (status == 0) { + node->timeout.tv_usec = timeout * 1000; + node->timeout.tv_sec = node->timeout.tv_usec / 1000000L; + node->timeout.tv_usec %= 1000000L; + } } else if (strcasecmp("Prefix", child->key) == 0) { status = cf_util_get_string(child, &node->prefix); } else if (strcasecmp("Database", child->key) == 0) {