public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Samuli Suominen (ssuominen)" <ssuominen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/lm_sensors/files: lm_sensors-3.1.2-changeset_r5835.patch
Date: Sun, 27 Jun 2010 18:48:46 +0000 (UTC)	[thread overview]
Message-ID: <20100627184846.1F58E2CF96@corvid.gentoo.org> (raw)

ssuominen    10/06/27 18:48:46

  Added:                lm_sensors-3.1.2-changeset_r5835.patch
  Log:
  Fix support of multiple chips wrt #325083 by Horst Prote.
  (Portage version: 2.2_rc67/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  sys-apps/lm_sensors/files/lm_sensors-3.1.2-changeset_r5835.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/lm_sensors/files/lm_sensors-3.1.2-changeset_r5835.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/lm_sensors/files/lm_sensors-3.1.2-changeset_r5835.patch?rev=1.1&content-type=text/plain

Index: lm_sensors-3.1.2-changeset_r5835.patch
===================================================================
http://bugs.gentoo.org/325083
http://www.lm-sensors.org/changeset/5835

--- prog/sensord/rrd.c
+++ prog/sensord/rrd.c
@@ -138,7 +138,9 @@
 }
 
+/* Returns the number of features processed, or -1 on error */
 static int _applyToFeatures(FeatureFN fn, void *data,
 			    const sensors_chip_name *chip,
-			    const ChipDescriptor *desc)
+			    const ChipDescriptor *desc,
+			    int labelOffset)
 {
 	int i;
@@ -148,5 +150,5 @@
 	char *label;
 
-	for (i = 0; i < MAX_RRD_SENSORS && features[i].format; ++i) {
+	for (i = 0; labelOffset + i < MAX_RRD_SENSORS && features[i].format; ++i) {
 		feature = features + i;
 		rawLabel = feature->feature->name;
@@ -159,9 +161,9 @@
 		}
 
-		rrdCheckLabel(rawLabel, i);
-		fn(data, rrdLabels[i], label, feature);
+		rrdCheckLabel(rawLabel, labelOffset + i);
+		fn(data, rrdLabels[labelOffset + i], label, feature);
 		free(label);
 	}
-	return 0;
+	return i;
 }
 
@@ -185,5 +187,5 @@
 static int applyToFeatures(FeatureFN fn, void *data)
 {
-	int i, i_detected, ret;
+	int i, i_detected, ret, labelOffset = 0;
 	const sensors_chip_name *chip, *chip_arg;
 	ChipDescriptor *desc;
@@ -198,7 +200,8 @@
 				continue;
 
-			ret = _applyToFeatures(fn, data, chip, desc);
-			if (ret)
+			ret = _applyToFeatures(fn, data, chip, desc, labelOffset);
+			if (ret < 0)
 				return ret;
+			labelOffset += ret;
 		}
 	}






             reply	other threads:[~2010-06-27 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-27 18:48 Samuli Suominen (ssuominen) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-28  6:30 [gentoo-commits] gentoo-x86 commit in sys-apps/lm_sensors/files: lm_sensors-3.1.2-changeset_r5835.patch Samuli Suominen (ssuominen)
2011-03-25 20:54 Samuli Suominen (ssuominen)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100627184846.1F58E2CF96@corvid.gentoo.org \
    --to=ssuominen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox