[collectd] [PATCH] sensors plugin: Avoid assertion in
ignorelist_match () when not configured.
Sebastian Harl
sh<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>tokkee.org
Sat Dec 23 14:01:14 CET 2006
If the sensors plugin is not configured (i.e. default settings are used) the
ignorelist (sensors_list) is never created causing the assertion in
ignorelist_match () to fail. This fixes it.
Signed-off-by: Sebastian Harl <sh.trailing-username(a)leading-domain.tokkee.org>
---
src/sensors.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/sensors.c b/src/sensors.c
index d15569c..66cd5b2 100644
--- a/src/sensors.c
+++ b/src/sensors.c
@@ -393,7 +393,8 @@ #if SENSORS_HAVE_READ
sensors_free_features ();
#endif /* if SENSORS_HAVE_READ */
- ignorelist_free (sensor_list);
+ if (NULL != sensor_list)
+ ignorelist_free (sensor_list);
}
static void sensors_voltage_write (char *host, char *inst, char *val)
@@ -402,7 +403,7 @@ static void sensors_voltage_write (char
int status;
/* skip ignored in our config */
- if (ignorelist_match (sensor_list, inst))
+ if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst))
return;
/* extended sensor naming */
@@ -423,7 +424,7 @@ static void sensors_write (char *host, c
int status;
/* skip ignored in our config */
- if (ignorelist_match (sensor_list, inst))
+ if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst))
return;
/* extended sensor naming */
@@ -450,7 +451,7 @@ static void sensors_submit (const char *
return;
/* skip ignored in our config */
- if (ignorelist_match (sensor_list, inst))
+ if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst))
return;
if (snprintf (buf, BUFSIZE, "%u:%.3f", (unsigned int) curtime,
--
1.4.3.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20061223/70569643/attachment.pgp
More information about the collectd
mailing list