File: fix-storing-local-variables

package info (click to toggle)
collectd 5.12.0-14
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,424 kB
  • sloc: ansic: 120,843; perl: 20,684; php: 3,007; makefile: 2,423; java: 1,713; javascript: 920; python: 892; sh: 781; cpp: 638; yacc: 231; sql: 198; lex: 146; ruby: 49; xml: 44
file content (43 lines) | stat: -rw-r--r-- 1,508 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Index: collectd/src/capabilities.c
===================================================================
--- collectd.orig/src/capabilities.c
+++ collectd/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
    * 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);
Index: collectd/src/write_prometheus.c
===================================================================
--- collectd.orig/src/write_prometheus.c
+++ collectd/src/write_prometheus.c
@@ -63,6 +63,7 @@ static pthread_mutex_t metrics_lock = PT
 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
    * 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;
   }