diff options
author | Yojiro Uo <yuo@cvs.openbsd.org> | 2011-09-16 20:52:49 +0000 |
---|---|---|
committer | Yojiro Uo <yuo@cvs.openbsd.org> | 2011-09-16 20:52:49 +0000 |
commit | 18745ce448e248133b3cceaadd8a5f6a10f50e81 (patch) | |
tree | d0b5bc26a628d4dc01418634148ebc00ad5d76ed /usr.bin/systat/sensors.c | |
parent | 9bb685bee6da4388868a400480ecd22fb0a42865 (diff) |
reorder SENSOR_* in switch() and add missing cases.
ok deraadt@
Diffstat (limited to 'usr.bin/systat/sensors.c')
-rw-r--r-- | usr.bin/systat/sensors.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c index 1effdbfc14e..ab187b074dc 100644 --- a/usr.bin/systat/sensors.c +++ b/usr.bin/systat/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.25 2011/09/16 15:44:31 yuo Exp $ */ +/* $OpenBSD: sensors.c,v 1.26 2011/09/16 20:52:48 yuo Exp $ */ /* * Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org> @@ -224,13 +224,16 @@ showsensor(struct sensinfo *s) case SENSOR_FANRPM: tbprintf("%11lld RPM", s->sn_value); break; + case SENSOR_VOLTS_DC: + tbprintf("%10.2f V DC", + s->sn_value / 1000000.0); + break; case SENSOR_VOLTS_AC: tbprintf("%10.2f V AC", s->sn_value / 1000000.0); break; - case SENSOR_VOLTS_DC: - tbprintf("%10.2f V DC", - s->sn_value / 1000000.0); + case SENSOR_OHMS: + tbprintf("%11lld ohm", s->sn_value); break; case SENSOR_WATTS: tbprintf("%10.2f W", s->sn_value / 1000000.0); @@ -238,6 +241,12 @@ showsensor(struct sensinfo *s) case SENSOR_AMPS: tbprintf("%10.2f A", s->sn_value / 1000000.0); break; + case SENSOR_WATTHOUR: + tbprintf("%12.2f Wh", s->sn_value / 1000000.0); + break; + case SENSOR_AMPHOUR: + tbprintf("%10.2f Ah", s->sn_value / 1000000.0); + break; case SENSOR_INDICATOR: tbprintf("%15s", s->sn_value ? "On" : "Off"); break; @@ -260,12 +269,6 @@ showsensor(struct sensinfo *s) case SENSOR_TIMEDELTA: tbprintf("%15s", fmttime(s->sn_value / 1000000000.0)); break; - case SENSOR_WATTHOUR: - tbprintf("%12.2f Wh", s->sn_value / 1000000.0); - break; - case SENSOR_AMPHOUR: - tbprintf("%10.2f Ah", s->sn_value / 1000000.0); - break; case SENSOR_HUMIDITY: tbprintf("%3.2f%%", s->sn_value / 1000.0); break; |