From 5caecf5ba53ad31fa0626591c1ccc91fb47af955 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 17 Jun 2011 10:29:13 +0200 Subject: [PATCH] rrdcached plugin: Handle boolean config options as well. This was lost previously when changing to the complex config callback. --- src/rrdcached.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rrdcached.c b/src/rrdcached.c index f53ccad7..11c1c6a7 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -164,13 +164,20 @@ static int value_list_to_filename (char *buffer, int buffer_len, static const char *config_get_string (oconfig_item_t *ci) { if ((ci->children_num != 0) || (ci->values_num != 1) - || (ci->values[0].type != OCONFIG_TYPE_STRING)) + || ((ci->values[0].type != OCONFIG_TYPE_STRING) + && (ci->values[0].type != OCONFIG_TYPE_BOOLEAN))) { ERROR ("rrdcached plugin: %s expects a single string argument.", ci->key); return (NULL); } + if (ci->values[0].type == OCONFIG_TYPE_BOOLEAN) { + if (ci->values[0].value.boolean) + return "true"; + else + return "false"; + } return (ci->values[0].value.string); } /* const char *config_get_string */ -- 2.30.2