1 Based on patch from Pavel Rochnyack
2 https://git.ipfire.org/?p=thirdparty/collectd.git;a=commitdiff;h=d5a3c020d33cc33ee8049f54c7b4dffcd123bf83
4 diff -Naur collectd-4.10.9/src/sensors.c.orig collectd-4.10.9/src/sensors.c
5 --- collectd-4.10.9/src/sensors.c.orig 2013-04-08 08:26:17.000000000 +0200
6 +++ collectd-4.10.9/src/sensors.c 2021-04-13 23:17:43.196069346 +0200
9 /* #endif SENSORS_API_VERSION < 0x400 */
11 -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
12 +#elif (SENSORS_API_VERSION >= 0x400)
13 typedef struct featurelist
15 const sensors_chip_name *chip;
17 # ifndef SENSORS_CONF_PATH
18 # define SENSORS_CONF_PATH "/etc/sensors3.conf"
20 -/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
22 -#else /* if SENSORS_API_VERSION >= 0x500 */
23 -# error "This version of libsensors is not supported yet. Please report this " \
27 static const char *conffile = SENSORS_CONF_PATH;
29 } /* while sensors_get_detected_chips */
30 /* #endif SENSORS_API_VERSION < 0x400 */
32 -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
33 +#elif (SENSORS_API_VERSION >= 0x400)
35 while ((chip = sensors_get_detected_chips (NULL, &chip_num)) != NULL)
38 } /* while (subfeature) */
39 } /* while (feature) */
41 -#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
42 +#endif /* (SENSORS_API_VERSION >= 0x400) */
44 if (first_feature == NULL)
47 } /* for fl = first_feature .. NULL */
48 /* #endif SENSORS_API_VERSION < 0x400 */
50 -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
51 +#elif (SENSORS_API_VERSION >= 0x400)
52 for (fl = first_feature; fl != NULL; fl = fl->next)
57 sensors_submit (plugin_instance, type, type_instance, value);
58 } /* for fl = first_feature .. NULL */
59 -#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
60 +#endif /* (SENSORS_API_VERSION >= 0x400) */
63 } /* int sensors_read */