diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/Makefile | 4 | ||||
-rw-r--r-- | usr.bin/systat/sensors.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile index 097a755496f..d8e8aaab908 100644 --- a/usr.bin/systat/Makefile +++ b/usr.bin/systat/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.28 2018/05/30 13:43:50 krw Exp $ +# $OpenBSD: Makefile,v 1.29 2024/11/08 08:45:47 matthieu Exp $ PROG= systat @@ -12,6 +12,6 @@ SRCS= dkstats.c engine.c if.c inetname.c iostat.c main.c mbufs.c netstat.c \ pool.c malloc.c cpu.c uvm.c DPADD= ${LIBCURSES} ${LIBM} ${LIBKVM} -LDADD= -lcurses -lm -lkvm +LDADD= -lcurses -lm -lkvm -lutil .include <bsd.prog.mk> diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c index d1bba1017d6..a6341da0494 100644 --- a/usr.bin/systat/sensors.c +++ b/usr.bin/systat/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.32 2020/07/15 07:13:56 kettenis Exp $ */ +/* $OpenBSD: sensors.c,v 1.33 2024/11/08 08:45:47 matthieu Exp $ */ /* * Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org> @@ -29,6 +29,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <util.h> #include "systat.h" struct sensor sensor; @@ -274,7 +275,12 @@ showsensor(struct sensinfo *s) tbprintf("%3.2f%%", s->sn_value / 1000.0); break; case SENSOR_FREQ: - tbprintf("%11.2f Hz", s->sn_value / 1000000.0); + if (humanreadable) { + char buf[FMT_SCALED_STRSIZE]; + fmt_scaled(s->sn_value / 1000000.0, buf); + tbprintf("%sHz", buf); + } else + tbprintf("%11.2f Hz", s->sn_value / 1000000.0); break; case SENSOR_ANGLE: tbprintf("%3.4f degrees", s->sn_value / 1000000.0); |