summaryrefslogtreecommitdiff
path: root/usr.bin/systat/sensors.c
diff options
context:
space:
mode:
authorDeanna Phillips <deanna@cvs.openbsd.org>2007-03-04 21:17:38 +0000
committerDeanna Phillips <deanna@cvs.openbsd.org>2007-03-04 21:17:38 +0000
commite73d8a6bea2cc10fe7a9a5bf5a96f9f847d91367 (patch)
tree43f21d60af0f940aacfa63f6285ad5e712dc0989 /usr.bin/systat/sensors.c
parent9298094d593fc7070adff6eb868c29afb32dc210 (diff)
Clear the display so that the lines don't get overwritten with
hotplugged devices. Noticed by, similar fix proposed, mbalmer - Add missing CVS tag; constantine - Handle SENSOR_S_UNSPEC (do nothing for now). All discussed with Constanine and mbalmer; ok mbalmer.
Diffstat (limited to 'usr.bin/systat/sensors.c')
-rw-r--r--usr.bin/systat/sensors.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c
index c0fd8957add..5d8988f760b 100644
--- a/usr.bin/systat/sensors.c
+++ b/usr.bin/systat/sensors.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: sensors.c,v 1.8 2007/03/04 21:17:37 deanna Exp $ */
+
/*
* Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org>
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -76,6 +78,10 @@ fetchsensors(void)
row = 2;
sensor_cnt = 0;
+
+ wmove(wnd, row, 0);
+ wclrtobot(wnd);
+
for (dev = 0; dev < MAXSENSORDEVICES; dev++) {
mib[2] = dev;
if (sysctl(mib, 3, &sensordev, &sdlen, NULL, 0) == -1) {
@@ -183,6 +189,8 @@ printline(void)
mvwprintw(wnd, row, 58, "(%s)", sensor.desc);
switch (sensor.status) {
+ case SENSOR_S_UNSPEC:
+ break;
case SENSOR_S_UNKNOWN:
mvwaddstr(wnd, row, 45, "unknown");
break;