summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/sysctl/sysctl.c7
-rw-r--r--sys/sys/sensors.h5
2 files changed, 8 insertions, 4 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");
}
diff --git a/sys/sys/sensors.h b/sys/sys/sensors.h
index 48d37af9394..15c28163bfa 100644
--- a/sys/sys/sensors.h
+++ b/sys/sys/sensors.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.h,v 1.6 2005/08/03 14:53:39 dlg Exp $ */
+/* $OpenBSD: sensors.h,v 1.7 2005/08/05 03:07:41 dlg Exp $ */
/*
* Copyright (c) 2003, 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -40,7 +40,8 @@ enum sensor_type {
SENSOR_WATTHOUR, /* power capacity */
SENSOR_AMPHOUR, /* power capacity */
SENSOR_INDICATOR, /* boolean indicator */
- SENSOR_INTEGER /* generic integer value */
+ SENSOR_INTEGER, /* generic integer value */
+ SENSOR_PERCENT /* percent */
};
/* Sensor states */