diff options
author | Heikki Kallasjoki <fis@zem.fi> | 2018-12-12 16:10:34 +0000 |
---|---|---|
committer | Heikki Kallasjoki <fis+github@zem.fi> | 2018-12-12 19:10:51 +0000 |
commit | 79b14a8f79b63f79a282551c913f82ca4d1ed22d (patch) | |
tree | 504da4094d5d17678faf6b72174338597bab56f1 /hwmon.c | |
parent | 5ce4474f7e6cb2256fee2619b4695772768b65d3 (diff) | |
download | nano-exporter-79b14a8f79b63f79a282551c913f82ca4d1ed22d.tar.gz nano-exporter-79b14a8f79b63f79a282551c913f82ca4d1ed22d.tar.xz nano-exporter-79b14a8f79b63f79a282551c913f82ca4d1ed22d.zip |
Add basic test for the hwmon collector.
Diffstat (limited to 'hwmon.c')
-rw-r--r-- | hwmon.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hwmon.c b/hwmon.c index 43e9cd0..cccc209 100644 --- a/hwmon.c +++ b/hwmon.c @@ -24,6 +24,7 @@ #include <unistd.h> #include "collector.h" +#include "util.h" // size of input buffer for paths and lines #define BUF_SIZE 256 @@ -206,14 +207,14 @@ static void hwmon_collect(scrape_req *req, void *ctx) { // iterate over all hwmon instances in /sys/class/hwmon - root = opendir("/sys/class/hwmon"); + root = opendir(PATH("/sys/class/hwmon")); if (!root) return; while ((dent = readdir(root))) { if (strncmp(dent->d_name, "hwmon", 5) != 0) continue; - snprintf(path, sizeof path, "/sys/class/hwmon/%s", dent->d_name); + snprintf(path, sizeof path, PATH("/sys/class/hwmon/%s"), dent->d_name); hwmon_name(path, chip_label, sizeof chip_label); |