summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ccc69cc)
raw | patch | inline | side by side (parent: ccc69cc)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 17 Jun 2011 08:29:13 +0000 (10:29 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 17 Jun 2011 08:29:13 +0000 (10:29 +0200) |
This was lost previously when changing to the complex config callback.
src/rrdcached.c | patch | blob | history |
diff --git a/src/rrdcached.c b/src/rrdcached.c
index f53ccad7ab5bac6f4a121d35459bfa461f6e31d7..11c1c6a7f85c3e96c2380602094c81f09e4bb97f 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
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 */