Hi again,

sorry for replying to my own message, but the original patch was not
including the call to free() the buffer again.

Regards,
Jakob

-- 
ceterum censeo microsoftem esse delendam.
From 5f33273eed6ce1d41b35e2e392350421d9af82ff Mon Sep 17 00:00:00 2001
From: Jakob Haufe <[email protected]>
Date: Tue, 9 Feb 2010 19:06:37 +0100
Subject: [PATCH] Use sensor labels (description) from lm-sensors

---
 src/sensors.c |	8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/sensors.c b/src/sensors.c
index 8391346..69d5ab5 100644
--- a/src/sensors.c
+++ b/src/sensors.c
@@ -560,8 +560,12 @@ static int sensors_read (void)
		if (status < 0)
			continue;
 
-		sstrncpy (type_instance, fl->feature->name,
-				sizeof (type_instance));
+		/* get sensor label (description) from lm_sensors */
+		char *sensor_label;
+		sensor_label = sensors_get_label(fl->chip, fl->feature);
+		sstrncpy(type_instance, sensor_label, sizeof(type_instance));
+		free(sensor_label);
+
 
		if (fl->feature->type == SENSORS_FEATURE_IN)
			type = "voltage";
-- 
1.6.6.1

Attachment: signature.asc
Description: PGP signature

_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd

Reply via email to