summaryrefslogtreecommitdiff
path: root/app-metrics/collectd/files/collectd-5.8.1-lm_sensors-4.5.0-compatibility.patch
blob: 3476d50664a543ead3eae28aa38cf2d99c89bc10 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
https://github.com/collectd/collectd/issues/3006

--- old/src/sensors.c
+++ new/src/sensors.c
@@ -149,7 +149,7 @@
 static char *conffile = SENSORS_CONF_PATH;
 /* #endif SENSORS_API_VERSION < 0x400 */
 
-#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
+#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x600)
 typedef struct featurelist {
   const sensors_chip_name *chip;
   const sensors_feature *feature;
@@ -159,9 +159,9 @@
 
 static char *conffile = NULL;
 static _Bool use_labels = 0;
-/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
+/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x600) */
 
-#else /* if SENSORS_API_VERSION >= 0x500 */
+#else /* if SENSORS_API_VERSION >= 0x600 */
 #error "This version of libsensors is not supported yet. Please report this " \
 	"as bug."
 #endif
@@ -223,7 +223,7 @@
     if (IS_TRUE(value))
       ignorelist_set_invert(sensor_list, 0);
   }
-#if (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
+#if (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x600)
   else if (strcasecmp(key, "UseLabels") == 0) {
     use_labels = IS_TRUE(value) ? 1 : 0;
   }
@@ -353,7 +353,7 @@
   }   /* while sensors_get_detected_chips */
 /* #endif SENSORS_API_VERSION < 0x400 */
 
-#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
+#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x600)
   chip_num = 0;
   while ((chip = sensors_get_detected_chips(NULL, &chip_num)) != NULL) {
     const sensors_feature *feature;
@@ -410,7 +410,7 @@
       } /* while (subfeature) */
     }   /* while (feature) */
   }     /* while (chip) */
-#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
+#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x600) */
 
   if (first_feature == NULL) {
     sensors_cleanup();
@@ -485,7 +485,7 @@
   } /* for fl = first_feature .. NULL */
 /* #endif SENSORS_API_VERSION < 0x400 */
 
-#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
+#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x600)
   for (featurelist_t *fl = first_feature; fl != NULL; fl = fl->next) {
     double value;
     int status;
@@ -528,7 +528,7 @@
 
     sensors_submit(plugin_instance, type, type_instance, value);
   } /* for fl = first_feature .. NULL */
-#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
+#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x600) */
 
   return 0;
 } /* int sensors_read */