X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrdcached.c;h=3d7ae05aee9c824b2a16c5a69389a8a5fb2059ce;hb=4e89060ceb1a14ec7f9abfe9caa6b0da7e76bd5c;hp=82870135fe0aabace9a772e357be2e4d0597d0ba;hpb=3d082a905619c19ca5b7183bb95a30d4d9529c4d;p=collectd.git diff --git a/src/rrdcached.c b/src/rrdcached.c index 82870135..3d7ae05a 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -39,8 +39,8 @@ */ static char *datadir = NULL; static char *daemon_address = NULL; -static _Bool config_create_files = 1; -static _Bool config_collect_stats = 1; +static bool config_create_files = true; +static bool config_collect_stats = true; static rrdcreate_config_t rrdcreate_config = { /* stepsize = */ 0, /* heartbeat = */ 0, @@ -88,8 +88,8 @@ static int value_list_to_string(char *buffer, int buffer_len, return -1; if (ds->ds[i].type == DS_TYPE_COUNTER) { - status = snprintf(buffer + offset, buffer_len - offset, ":%llu", - vl->values[i].counter); + status = snprintf(buffer + offset, buffer_len - offset, ":%" PRIu64, + (uint64_t)vl->values[i].counter); } else if (ds->ds[i].type == DS_TYPE_GAUGE) { status = snprintf(buffer + offset, buffer_len - offset, ":%f", vl->values[i].gauge); @@ -284,7 +284,7 @@ static int try_reconnect(void) { static int rc_read(void) { int status; rrdc_stats_t *head; - _Bool retried = 0; + bool retried = 0; value_list_t vl = VALUE_LIST_INIT; vl.values = &(value_t){.gauge = NAN}; @@ -392,7 +392,7 @@ static int rc_write(const data_set_t *ds, const value_list_t *vl, char values[512]; char *values_array[2]; int status; - _Bool retried = 0; + bool retried = 0; if (daemon_address == NULL) { ERROR("rrdcached plugin: daemon_address == NULL."); @@ -424,9 +424,7 @@ static int rc_write(const data_set_t *ds, const value_list_t *vl, status = stat(filename, &statbuf); if (status != 0) { if (errno != ENOENT) { - char errbuf[1024]; - ERROR("rrdcached plugin: stat (%s) failed: %s", filename, - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("rrdcached plugin: stat (%s) failed: %s", filename, STRERRNO); return -1; } @@ -476,7 +474,7 @@ static int rc_flush(__attribute__((unused)) cdtime_t timeout, /* {{{ */ __attribute__((unused)) user_data_t *ud) { char filename[PATH_MAX + 1]; int status; - _Bool retried = 0; + bool retried = 0; if (identifier == NULL) return EINVAL;