[collectd] [PATCH] sensors 02: make sensors.conf path configurable

Lubos Stanek kolektor<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>atlas.cz
Mon Dec 11 23:34:30 CET 2006


Signed-off-by: Stanek Lubos <kolektor<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>atlas.cz>
---
 src/sensors.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/sensors.c b/src/sensors.c
index 93f93fc..6ba8154 100644
--- a/src/sensors.c
+++ b/src/sensors.c
@@ -179,6 +179,12 @@ static ignorelist_t *sensor_list;
 static int sensor_extended_naming = 0;
 
 #if SENSORS_HAVE_READ
+#ifndef SENSORS_CONF_PATH
+# define SENSORS_CONF_PATH "/etc/sensors.conf"
+#endif
+static const char *conffile = SENSORS_CONF_PATH;
+/* SENSORS_CONF_PATH */
+
 typedef struct featurelist
 {
 	const sensors_chip_name    *chip;
@@ -254,7 +260,7 @@ #ifdef assert
 	assert (last_feature == NULL);
 #endif
 
-	if ((fh = fopen ("/etc/sensors.conf", "r")) == NULL)
+	if ((fh = fopen (conffile, "r")) == NULL)
 		return;
 
 	if (sensors_init (fh))
-- 
1.4.2.4




More information about the collectd mailing list