X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrdcached.c;h=11c1c6a7f85c3e96c2380602094c81f09e4bb97f;hb=77311aed583ac4566d76f1ce3a1dc9deae2e59dc;hp=f53ccad7ab5bac6f4a121d35459bfa461f6e31d7;hpb=ccc69cc64e79170e09eb3eae9cb9d2d22c6f06e6;p=collectd.git 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 */