summaryrefslogtreecommitdiff
path: root/sbin/sysctl
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2005-08-05 03:07:42 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2005-08-05 03:07:42 +0000
commit2820e3e9c692ea8ac76b3e1a102ad1959ec9a1b9 (patch)
tree5e11b523a02c39ea9a5219ed04d8f97c731bfa5e /sbin/sysctl
parentf39d3fe8adcca3c8ec9f97c1d841716463999ce0 (diff)
add a sensor type that can report percentage
ok deraadt@
Diffstat (limited to 'sbin/sysctl')
-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 8237b97fd71..d821d099a23 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.127 2005/08/04 16:00:06 deraadt Exp $ */
+/* $OpenBSD: sysctl.c,v 1.128 2005/08/05 03:07:40 dlg 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.127 2005/08/04 16:00:06 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.128 2005/08/05 03:07:40 dlg Exp $";
#endif
#endif /* not lint */
@@ -2155,6 +2155,9 @@ print_sensor(struct sensor *s)
case SENSOR_INTEGER:
printf("raw, %lld", s->value);
break;
+ case SENSOR_PERCENT:
+ printf("percent, %.2f%%", (float)s->value / 1000.0);
+ break;
default:
printf("unknown");
}