diff options
author | Chris Kuethe <ckuethe@cvs.openbsd.org> | 2007-03-23 06:56:41 +0000 |
---|---|---|
committer | Chris Kuethe <ckuethe@cvs.openbsd.org> | 2007-03-23 06:56:41 +0000 |
commit | d27fc4985a5ca60eba50c1f32ef330c9ea1db864 (patch) | |
tree | 8c2a04e6f2f2ae52586b9b1bc27158cf58f6e1eb /usr.bin/systat/sensors.c | |
parent | 230fd8b4f769a1c6c8a1d5d58f28ef2d9ba16611 (diff) |
display a timedelta of 0 in seconds, not some other unit.
requested by otto, ok otto
Diffstat (limited to 'usr.bin/systat/sensors.c')
-rw-r--r-- | usr.bin/systat/sensors.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c index c0c86eb64bf..d4aa6872503 100644 --- a/usr.bin/systat/sensors.c +++ b/usr.bin/systat/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.9 2007/03/23 01:10:38 ckuethe Exp $ */ +/* $OpenBSD: sensors.c,v 1.10 2007/03/23 06:56:40 ckuethe Exp $ */ /* * Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org> @@ -235,6 +235,8 @@ fmttime(double in) } else if (in >= 1 ){ unit = "sec"; /* in *= 1; */ /* no op */ + } else if (in == 0 ){ /* direct comparisons to floats are scary */ + unit = "sec"; } else if (in >= 1e-3 ){ unit = "mS"; in *= 1e3; |