summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorYojiro Uo <yuo@cvs.openbsd.org>2011-09-16 15:44:32 +0000
committerYojiro Uo <yuo@cvs.openbsd.org>2011-09-16 15:44:32 +0000
commita5702831fb2d3d9306138b06c93e7ddec5d1f1a7 (patch)
treeabb0e70b1aa380656b6348da9b262b44b05583ab /usr.sbin
parent013ecffea263f11694723e5f31b18f9f0b88bad0 (diff)
apply following changes to sensor framework:
- change accuracy of SENSOR_FREQ from Hz to muHz - add SENSOR_VOLTS_AC entry to userland programs ok deraadt@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sensorsd/sensorsd.c8
-rw-r--r--usr.sbin/snmpd/mib.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c
index b012e4d930b..9a91c95b8a3 100644
--- a/usr.sbin/sensorsd/sensorsd.c
+++ b/usr.sbin/sensorsd/sensorsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensorsd.c,v 1.49 2010/04/21 04:07:13 deraadt Exp $ */
+/* $OpenBSD: sensorsd.c,v 1.50 2011/09/16 15:44:31 yuo Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -623,6 +623,9 @@ print_sensor(enum sensor_type type, int64_t value)
case SENSOR_FANRPM:
snprintf(fbuf, RFBUFSIZ, "%lld RPM", value);
break;
+ case SENSOR_VOLTS_AC:
+ snprintf(fbuf, RFBUFSIZ, "%.2f V AC", value / 1000000.0);
+ break;
case SENSOR_VOLTS_DC:
snprintf(fbuf, RFBUFSIZ, "%.2f V DC", value / 1000000.0);
break;
@@ -662,6 +665,9 @@ print_sensor(enum sensor_type type, int64_t value)
case SENSOR_ANGLE:
snprintf(fbuf, RFBUFSIZ, "%lld", value);
break;
+ case SENSOR_FREQ:
+ snprintf(fbuf, RFBUFSIZ, "%.2f Hz", value / 1000000.0);
+ break;
default:
snprintf(fbuf, RFBUFSIZ, "%lld ???", value);
}
diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c
index 9c088a63d03..aa508785ff7 100644
--- a/usr.sbin/snmpd/mib.c
+++ b/usr.sbin/snmpd/mib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mib.c,v 1.45 2011/07/04 04:34:14 claudio Exp $ */
+/* $OpenBSD: mib.c,v 1.46 2011/09/16 15:44:31 yuo Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net>
@@ -1378,6 +1378,7 @@ mib_sensorvalue(struct sensor *s)
case SENSOR_WATTHOUR:
case SENSOR_AMPHOUR:
case SENSOR_LUX:
+ case SENSOR_FREQ:
ret = asprintf(&v, "%.2f", s->value / 1000000.0);
break;
case SENSOR_INDICATOR:
@@ -1398,7 +1399,6 @@ mib_sensorvalue(struct sensor *s)
/* FALLTHROUGH */
case SENSOR_FANRPM:
case SENSOR_INTEGER:
- case SENSOR_FREQ:
default:
ret = asprintf(&v, "%lld", s->value);
break;