static cdtime_t staleness_delta = PROMETHEUS_DEFAULT_STALENESS_DELTA;
-/* Unfortunately, protoc-c doesn't export it's implementation of varint, so we
+/* Unfortunately, protoc-c doesn't export its implementation of varint, so we
* need to implement our own. */
static size_t varint(uint8_t buffer[static VARINT_UINT32_BYTES],
uint32_t value) {
char const *accept = MHD_lookup_connection_value(connection, MHD_HEADER_KIND,
MHD_HTTP_HEADER_ACCEPT);
- _Bool want_proto =
- (accept != NULL) &&
- (strstr(accept, "application/vnd.google.protobuf") != NULL);
+ bool want_proto = (accept != NULL) &&
+ (strstr(accept, "application/vnd.google.protobuf") != NULL);
uint8_t scratch[4096] = {0};
ProtobufCBufferSimple simple = PROTOBUF_C_BUFFER_SIMPLE_INIT(scratch);
* 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.");
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;
for (size_t i = 0; i < ds->ds_num; i++) {
Io__Prometheus__Client__MetricFamily *fam =
- metric_family_get(ds, vl, i, /* allocate = */ 1);
+ metric_family_get(ds, vl, i, /* allocate = */ true);
if (fam == NULL)
continue;
for (size_t i = 0; i < ds->ds_num; i++) {
Io__Prometheus__Client__MetricFamily *fam =
- metric_family_get(ds, vl, i, /* allocate = */ 0);
+ metric_family_get(ds, vl, i, /* allocate = */ false);
if (fam == NULL)
continue;