From: Collectd Packaging Team Date: Mon, 22 Aug 2022 15:24:43 +0000 (+0100) Subject: fix-storing-local-variables X-Git-Tag: archive/raspbian/5.12.0-11+rpi1^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=93dd973d692c5a560360a9cf73a933ed2f9c3033;p=collectd.git fix-storing-local-variables =================================================================== Gbp-Pq: Name fix-storing-local-variables --- diff --git a/src/capabilities.c b/src/capabilities.c index a3a31c1..644c16b 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -56,6 +56,8 @@ static char *httpd_host = NULL; static unsigned short httpd_port = 9104; static struct MHD_Daemon *httpd; +static int mhd_cls = 44; + static dmi_type_name_t types_list[] = { {BIOS, "BIOS"}, {SYSTEM, "SYSTEM"}, @@ -206,7 +208,7 @@ static MHD_RESULT cap_http_handler(void *cls, struct MHD_Connection *connection, * round. The docs are not very specific on the issue. */ if (*connection_state == NULL) { /* set to a random non-NULL pointer. */ - *connection_state = &(int){44}; + *connection_state = &mhd_cls; return MHD_YES; } DEBUG(CAP_PLUGIN ": formatted response: %s", g_cap_json); diff --git a/src/write_prometheus.c b/src/write_prometheus.c index 7596b55..8e02753 100644 --- a/src/write_prometheus.c +++ b/src/write_prometheus.c @@ -63,6 +63,7 @@ static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER; static char *httpd_host = NULL; static unsigned short httpd_port = 9103; static struct MHD_Daemon *httpd; +static int mhd_cls = 42; static cdtime_t staleness_delta = PROMETHEUS_DEFAULT_STALENESS_DELTA; @@ -247,7 +248,7 @@ static MHD_RESULT http_handler(void *cls, struct MHD_Connection *connection, * very specific on the issue. */ if (*connection_state == NULL) { /* set to a random non-NULL pointer. */ - *connection_state = &(int){42}; + *connection_state = &mhd_cls; return MHD_YES; }