sensors/lm_sensors-r6030-fix-power-interval-output.patch
Jean Delvare 933f01c077 - lm_sensors-r5993-fix-loading-of-cpuid-module.patch: Fix loading
of the cpuid module.
- lm_sensors-r6016-handle-superio-wo-logdev.patch: Properly handle
  Super-I/O chips without logical device.
- lm_sensors-r6017-fix-sysfs-detection.patch: libsensors: Change
  sysfs detection to survive upcoming kernel changes (bnc#751180).
- lm_sensors-r6025-sensord-fix-memory-leaks.patch: sensord: Fix
  memory leaks revealed by valgrind (bnc#751177).
- lm_sensors-r6030-fix-power-interval-output.patch: Fix power
  interval output.

OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=46
2012-03-08 09:39:01 +00:00

40 lines
1.0 KiB
Diff

Fix power interval output
Power interval is measured in seconds, not Watt.
---
prog/sensors/chips.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
--- lm_sensors-3.3.1.orig/prog/sensors/chips.c
+++ lm_sensors-3.3.1/prog/sensors/chips.c
@@ -564,11 +564,25 @@ static void print_chip_power(const senso
} else
printf(" N/A ");
- for (i = 0; i < sensor_count; i++)
- scale_value(&sensors[i].value, &sensors[i].unit);
+ for (i = 0; i < sensor_count; i++) {
+ /*
+ * Unit is W and needs to be scaled for all attributes except
+ * interval, which does not need to be scaled and is reported in
+ * seconds.
+ */
+ if (strcmp(sensors[i].name, "interval")) {
+ char *tmpstr;
+ tmpstr = alloca(4);
+ scale_value(&sensors[i].value, &unit);
+ snprintf(tmpstr, 4, "%sW", unit);
+ sensors[i].unit = tmpstr;
+ } else {
+ sensors[i].unit = "s";
+ }
+ }
print_limits(sensors, sensor_count, alarms, alarm_count,
- label_size, "%s = %6.2f %sW");
+ label_size, "%s = %6.2f %s");
printf("\n");
}