summaryrefslogtreecommitdiff
path: root/usr.sbin/sensorsd
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2005-08-04 13:01:44 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2005-08-04 13:01:44 +0000
commit3c34c4300e45ee1e9eab78a40da1a7dfb6cadc74 (patch)
tree36ea73523ab25c9b9bfe1652bb61eaebed91ca9f /usr.sbin/sensorsd
parentfe7d5fe430c9724586d3cd5bd0f15fada5c1a089 (diff)
Support for SENSOR_INTEGER.
ok grange@, dlg@, henning@
Diffstat (limited to 'usr.sbin/sensorsd')
-rw-r--r--usr.sbin/sensorsd/sensorsd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c
index 4a316927da5..c9438012eee 100644
--- a/usr.sbin/sensorsd/sensorsd.c
+++ b/usr.sbin/sensorsd/sensorsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensorsd.c,v 1.17 2005/08/03 17:30:05 deraadt Exp $ */
+/* $OpenBSD: sensorsd.c,v 1.18 2005/08/04 13:01:43 jsg Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -315,6 +315,9 @@ print_sensor(enum sensor_type type, int64_t value)
case SENSOR_VOLTS_DC:
snprintf(fbuf, RFBUFSIZ, "%.2fV", value / 1000.0 / 1000.0);
break;
+ case SENSOR_INTEGER:
+ snprintf(fbuf, RFBUFSIZ, "%lld", value);
+ break;
default:
snprintf(fbuf, RFBUFSIZ, "%lld ???", value);
}
@@ -403,6 +406,9 @@ get_val(char *buf, int upper, enum sensor_type type)
errx(1, "unknown unit %s for voltage sensor", p);
rval = val * 1000 * 1000;
break;
+ case SENSOR_INTEGER:
+ rval = val;
+ break;
default:
errx(1, "unsupported sensor type");
/* not reached */