X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Frrdcached.c;h=8b742bb5574ea1f1a7b5bfc6aaa986ad52095382;hp=529d29c130dd0c1b9a071235d599913a060f47ec;hb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;hpb=687e10aea101bf6338d31e69dd6537202bc5acc1 diff --git a/src/rrdcached.c b/src/rrdcached.c index 529d29c1..8b742bb5 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -37,10 +37,10 @@ /* * Private variables */ -static char *datadir = NULL; -static char *daemon_address = NULL; -static _Bool config_create_files = 1; -static _Bool config_collect_stats = 1; +static char *datadir; +static char *daemon_address; +static bool config_create_files = true; +static bool config_collect_stats = true; static rrdcreate_config_t rrdcreate_config = { /* stepsize = */ 0, /* heartbeat = */ 0, @@ -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 = false; value_list_t vl = VALUE_LIST_INIT; vl.values = &(value_t){.gauge = NAN}; @@ -320,7 +320,7 @@ static int rc_read(void) { break; if (!retried) { - retried = 1; + retried = true; if (try_reconnect() == 0) continue; /* else: report the error and fail */ @@ -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 = false; if (daemon_address == NULL) { ERROR("rrdcached plugin: daemon_address == NULL."); @@ -455,7 +455,7 @@ static int rc_write(const data_set_t *ds, const value_list_t *vl, break; if (!retried) { - retried = 1; + retried = true; if (try_reconnect() == 0) continue; /* else: report the error and fail */ @@ -474,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 = false; if (identifier == NULL) return EINVAL; @@ -502,7 +502,7 @@ static int rc_flush(__attribute__((unused)) cdtime_t timeout, /* {{{ */ break; if (!retried) { - retried = 1; + retried = true; if (try_reconnect() == 0) continue; /* else: report the error and fail */