diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-08-04 13:01:44 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-08-04 13:01:44 +0000 |
commit | 3c34c4300e45ee1e9eab78a40da1a7dfb6cadc74 (patch) | |
tree | 36ea73523ab25c9b9bfe1652bb61eaebed91ca9f | |
parent | fe7d5fe430c9724586d3cd5bd0f15fada5c1a089 (diff) |
Support for SENSOR_INTEGER.
ok grange@, dlg@, henning@
-rw-r--r-- | sbin/sysctl/sysctl.c | 7 | ||||
-rw-r--r-- | usr.sbin/sensorsd/sensorsd.c | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 46a421e2e5f..898bc5d0ea5 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.125 2005/08/04 03:53:08 dlg Exp $ */ +/* $OpenBSD: sysctl.c,v 1.126 2005/08/04 13:00:44 jsg 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.125 2005/08/04 03:53:08 dlg Exp $"; +static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.126 2005/08/04 13:00:44 jsg Exp $"; #endif #endif /* not lint */ @@ -2148,6 +2148,9 @@ print_sensor(struct sensor *s) case SENSOR_INDICATOR: printf("indicator, %s", s->value ? "On" : "Off"); break; + case SENSOR_INTEGER: + printf("raw, %lld", s->value); + break; default: printf("unknown"); } 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 */ |