X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrdcached.c;h=8b742bb5574ea1f1a7b5bfc6aaa986ad52095382;hb=07ba05937aeaedd683656c3912040950dbf4a152;hp=3d7ae05aee9c824b2a16c5a69389a8a5fb2059ce;hpb=4e89060ceb1a14ec7f9abfe9caa6b0da7e76bd5c;p=collectd.git diff --git a/src/rrdcached.c b/src/rrdcached.c index 3d7ae05a..8b742bb5 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -37,8 +37,8 @@ /* * Private variables */ -static char *datadir = NULL; -static char *daemon_address = NULL; +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 = { @@ -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 */