X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcollectd-tg.c;h=92d1f012c97a4eb3e3bba821dcb04100779fc856;hp=170df2a6cdf3eb6a517929c78bca0a82fa2ce9a1;hb=48efd3deb4c9139fd060ff3d289896e9031bcc7c;hpb=029b489b237a8785c539f85d4840a49ba6743603 diff --git a/src/collectd-tg.c b/src/collectd-tg.c index 170df2a6..92d1f012 100644 --- a/src/collectd-tg.c +++ b/src/collectd-tg.c @@ -43,7 +43,7 @@ #include #include -#include "utils_heap.h" +#include "utils/heap/heap.h" #include "collectd/client.h" #include "collectd/network.h" @@ -62,7 +62,7 @@ static const char *conf_service = NET_DEFAULT_PORT; static lcc_network_t *net; -static c_heap_t *values_heap = NULL; +static c_heap_t *values_heap; static struct sigaction sigint_action; static struct sigaction sigterm_action; @@ -95,9 +95,9 @@ __attribute__((noreturn)) static void exit_usage(int exit_status) /* {{{ */ exit(exit_status); } /* }}} void exit_usage */ -static void signal_handler(int signal) /* {{{ */ +static void signal_handler(int __attribute__((unused)) signal) /* {{{ */ { - loop = 0; + loop = false; } /* }}} void signal_handler */ #if HAVE_CLOCK_GETTIME @@ -105,7 +105,7 @@ static double dtime(void) /* {{{ */ { struct timespec ts = {0}; - if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) + if (clock_gettime(CLOCK_REALTIME, &ts) != 0) perror("clock_gettime"); return (double)ts.tv_sec + (double)ts.tv_nsec / 1e9; @@ -196,7 +196,7 @@ static lcc_value_list_t *create_value_list(void) /* {{{ */ strncpy(vl->identifier.type, (vl->values_types[0] == LCC_TYPE_GAUGE) ? "gauge" : "derive", sizeof(vl->identifier.type)); - vl->identifier.type[sizeof(vl->identifier.type) - 1] = 0; + vl->identifier.type[sizeof(vl->identifier.type) - 1] = '\0'; snprintf(vl->identifier.type_instance, sizeof(vl->identifier.type_instance), "ti%li", random());