X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fchrony.c;h=353ede792f0627aae2e512439151349f050aeccd;hb=51bc7c4a5523f2b03c24e32064b28c7c8426534d;hp=1735b4954f34254bf61c0690aa000f72d0d95ef2;hpb=063a5e75b36173e89ffa18d32d47509f6ef968ec;p=collectd.git diff --git a/src/chrony.c b/src/chrony.c index 1735b495..353ede79 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -452,8 +452,8 @@ chrony_connect(void) if (chrony_set_timeout()) { - ERROR(PLUGIN_NAME ": Error setting timeout to %lds. Errno = %d", - g_chrony_timeout, errno); + ERROR(PLUGIN_NAME ": Error setting timeout to %llds. Errno = %d", + (long long)g_chrony_timeout, errno); return CHRONY_RC_FAIL; } return CHRONY_RC_OK; @@ -677,12 +677,9 @@ ntohf(tFloat p_float) static void chrony_push_data(const char *p_type, const char *p_type_inst, double p_value) { - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - values[0].gauge = p_value; /* TODO: Check type??? (counter, gauge, derive, absolute) */ - - vl.values = values; + vl.values = &(value_t) { .gauge = p_value }; vl.values_len = 1; /* XXX: Shall g_chrony_host/g_chrony_port be reflected in the plugin's output? */ @@ -1053,7 +1050,7 @@ chrony_read(void) { /* collectd read callback: Perform data acquisition */ int rc; - unsigned int now_src, n_sources; + unsigned int n_sources; if (g_chrony_seq_is_initialized == 0) { @@ -1075,7 +1072,7 @@ chrony_read(void) if (rc != CHRONY_RC_OK) return rc; - for (now_src = 0; now_src < n_sources; ++now_src) + for (unsigned int now_src = 0; now_src < n_sources; ++now_src) { int is_reachable; rc = chrony_request_source_data(now_src, &is_reachable);