summaryrefslogtreecommitdiff
path: root/sbin/sysctl/sysctl.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-08-12 12:26:52 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-08-12 12:26:52 +0000
commit8c4c94ca0b6d7bfd214b3fbb27691af29f3cc979 (patch)
treeec4079c7fd0f51b7520d9521ed3a55b596e4fde2 /sbin/sysctl/sysctl.c
parent88003a4a69e42cc5f48cb20d16faac1cb7786323 (diff)
Add support for SENSOR_WATTS.
ok deraadt@, oga@
Diffstat (limited to 'sbin/sysctl/sysctl.c')
-rw-r--r--sbin/sysctl/sysctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index efd52c4311e..d60686c45d4 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.161 2009/06/07 03:07:19 millert Exp $ */
+/* $OpenBSD: sysctl.c,v 1.162 2009/08/12 12:26:51 kettenis Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95";
#else
-static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.161 2009/06/07 03:07:19 millert Exp $";
+static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.162 2009/08/12 12:26:51 kettenis Exp $";
#endif
#endif /* not lint */
@@ -2356,6 +2356,9 @@ print_sensor(struct sensor *s)
case SENSOR_VOLTS_DC:
printf("%.2f VDC", s->value / 1000000.0);
break;
+ case SENSOR_WATTS:
+ printf("%.2f W", s->value / 1000000.0);
+ break;
case SENSOR_AMPS:
printf("%.2f A", s->value / 1000000.0);
break;