X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_prometheus.c;h=6903aa06c632990edb08b56f8b0236ad5a39cd32;hb=61a4ed99b1a5b6d371bb745933d0efc5dff9505c;hp=4c363b2d3e603fc471d1c178b2cf5abef91ae78b;hpb=79a8e6dee4b68231969434bf2a98a08c2bf8041e;p=collectd.git diff --git a/src/write_prometheus.c b/src/write_prometheus.c index 4c363b2d..6903aa06 100644 --- a/src/write_prometheus.c +++ b/src/write_prometheus.c @@ -244,7 +244,7 @@ static int http_handler(void *cls, struct MHD_Connection *connection, char const *accept = MHD_lookup_connection_value(connection, MHD_HEADER_KIND, MHD_HTTP_HEADER_ACCEPT); - _Bool want_proto = + bool want_proto = (accept != NULL) && (strstr(accept, "application/vnd.google.protobuf") != NULL); @@ -689,7 +689,7 @@ static char *metric_family_name(data_set_t const *ds, value_list_t const *vl, * necessary. */ static Io__Prometheus__Client__MetricFamily * metric_family_get(data_set_t const *ds, value_list_t const *vl, size_t ds_index, - _Bool allocate) { + bool allocate) { char *name = metric_family_name(ds, vl, ds_index); if (name == NULL) { ERROR("write_prometheus plugin: Allocating metric family name failed."); @@ -766,9 +766,8 @@ static int prom_open_socket(int addrfamily) { int tmp = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp)) != 0) { - char errbuf[1024]; WARNING("write_prometheus: setsockopt(SO_REUSEADDR) failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + STRERRNO); close(fd); fd = -1; continue;