X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_redis.c;h=72cb5946e962050d1569c33912232557fae71d0d;hb=711f5b6c86f51061c21bedcaa46214a01de0125c;hp=c17654b464d763fc9b6938a9a2da21e81b9ed2c4;hpb=a3bafd5a952b5cfacacb03f9fb2ac5988d1e39fb;p=collectd.git diff --git a/src/write_redis.c b/src/write_redis.c index c17654b4..72cb5946 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -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) {