X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrdcached.c;h=fb7eb79e8ec50eca5ab5d9273ff349d9fb5dd4cf;hb=f1b5b8611d87a7904c31ae4b28ea47f11f3c38b9;hp=728ada459d821f2c7cd4d009e14cdd882e01f59d;hpb=e21d0408e4e4001b8c66bb1ea7d41b890100d0f5;p=collectd.git diff --git a/src/rrdcached.c b/src/rrdcached.c index 728ada45..fb7eb79e 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -24,6 +24,8 @@ #include "common.h" #include "utils_rrdcreate.h" +#undef HAVE_CONFIG_H +#include #include /* @@ -62,12 +64,14 @@ static int value_list_to_string (char *buffer, int buffer_len, int offset; int status; int i; + time_t t; assert (0 == strcmp (ds->type, vl->type)); memset (buffer, '\0', buffer_len); - status = ssnprintf (buffer, buffer_len, "%u", (unsigned int) vl->time); + t = CDTIME_T_TO_TIME_T (vl->time); + status = ssnprintf (buffer, buffer_len, "%lu", (unsigned long) t); if ((status < 1) || (status >= buffer_len)) return (-1); offset = status; @@ -192,18 +196,14 @@ static int rc_config (const char *key, const char *value) } else if (strcasecmp ("CreateFiles", key) == 0) { - if ((strcasecmp ("false", value) == 0) - || (strcasecmp ("no", value) == 0) - || (strcasecmp ("off", value) == 0)) + if (IS_FALSE (value)) config_create_files = 0; else config_create_files = 1; } else if (strcasecmp ("CollectStatistics", key) == 0) { - if ((strcasecmp ("false", value) == 0) - || (strcasecmp ("no", value) == 0) - || (strcasecmp ("off", value) == 0)) + if (IS_FALSE (value)) config_collect_stats = 0; else config_collect_stats = 1;