summaryrefslogtreecommitdiff
path: root/util/isensor.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-08-13 17:06:45 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-08-13 17:06:45 +0200
commitdcc89cc2006fea0ca21fbe267930a0ac3c850b52 (patch)
tree491cc84ec0664e9a03c603b7dc9831c1d019bcf8 /util/isensor.c
parentfbb73ab679d399bd4f2b5943b0c6f3bf7ab2fe84 (diff)
New upstream version 3.0.6upstream/3.0.6
Diffstat (limited to 'util/isensor.c')
-rw-r--r--util/isensor.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/util/isensor.c b/util/isensor.c
index 1f772bd..a204990 100644
--- a/util/isensor.c
+++ b/util/isensor.c
@@ -255,7 +255,7 @@ char *decode_entity_id(int id) {
* Global Data
************************/
static char *progname = "isensor";
-static char *progver = "3.05";
+static char *progver = "3.06";
#ifdef WIN32
static char savefile[] = "%ipmiutildir%\\thresholds.cmd";
#else
@@ -655,17 +655,17 @@ char *get_unit_type(int iunits, int ibase, int imod, int fshort)
break;
}
if ((umod == 0) && (iunits > 0)) {
- /* special cases for other SensorUnits1 bits */
- if ((iunits & 0x01) != 0) { /*percentage*/
- if (fshort) pstr = "%";
- else pstr = "percent";
- } else if (iunits == 0xC0) { /*no analog reading*/
- pstr = "na";
- } else if (iunits == 0x18) {
- /* For Tyan fans: base=42, units=24.(0x18) -> cycles/hour */
- snprintf(unitstr,sizeof(unitstr),"%s/hour",punittypes[jbase]);
- pstr = unitstr;
- }
+ /* special cases for other SensorUnits1 bits */
+ if ((iunits & 0x01) != 0) { /*percentage*/
+ if (fshort) pstr = "%";
+ else pstr = "percent";
+ } else if (iunits == 0xC0) { /*no analog reading*/
+ pstr = "na";
+ } else if (iunits == 0x18) {
+ /* For Tyan fans: base=42, units=24.(0x18) -> cycles/hour */
+ snprintf(unitstr,sizeof(unitstr),"%s/hour",punittypes[jbase]);
+ pstr = unitstr;
+ }
}
return(pstr);
}
@@ -2650,6 +2650,7 @@ ShowSDR(char *tag, uchar *sdr)
sens[2],i,sens[0],sens[1],sdr01->sens_base,
sdr01->sens_units);
if ((sens[1] & 0x20) != 0) { i = 7; val = 0; } /* Init state */
+ else if (sdr01->sens_units == 0xC0) i = 42; /*reading NotAvailable*/
else if (sens[2] == 0xc7) { i = 10; val = 0; /* Absent (Intel) */
if (fdebug) printf("sensor[%x] is absent (c7), no reading\n",
sdr01->sens_num);