summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 38617fa)
raw | patch | inline | side by side (parent: 38617fa)
author | Florian Forster <octo@collectd.org> | |
Thu, 5 Oct 2017 18:17:21 +0000 (20:17 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 5 Oct 2017 18:17:24 +0000 (20:17 +0200) |
0.9.0 was released in July 2010, yet Precise, which we're still building for,
ships 0.4.6. *sigh*
ships 0.4.6. *sigh*
src/write_prometheus.c | patch | blob | history |
diff --git a/src/write_prometheus.c b/src/write_prometheus.c
index fe6f1cc3a536d563de8fa45cbdb563c02fcad147..21bfb54ff9eaad6920abfd79db4b7350cc6316da 100644 (file)
--- a/src/write_prometheus.c
+++ b/src/write_prometheus.c
@@ -731,6 +731,7 @@ metric_family_get(data_set_t const *ds, value_list_t const *vl, size_t ds_index,
}
/* }}} */
+#if MHD_VERSION >= 0x00090000
static int prom_open_socket(int domain, struct sockaddr const *addr,
socklen_t addrlen) {
int fd = socket(domain, SOCK_STREAM | SOCK_CLOEXEC, 0);
return d;
}
+#else /* if MHD_VERSION < 0x00090000 */
+static struct MHD_Daemon *prom_start_daemon() {
+ struct MHD_Daemon *d =
+ MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION, 0,
+ /* MHD_AcceptPolicyCallback = */ NULL,
+ /* MHD_AcceptPolicyCallback arg = */ NULL, http_handler,
+ NULL, MHD_OPTION_END);
+ if (d == NULL) {
+ ERROR("write_prometheus plugin: MHD_start_daemon() failed.");
+ return NULL;
+ }
+
+ return d;
+}
+#endif
/*
* collectd callbacks