From: Jean-Philippe Orsini Date: Wed, 17 Sep 2014 20:39:18 +0000 (+0200) Subject: avoid to store unknown values for the sensor X-Git-Tag: v1.1.2~61 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=24332d1608e683c9c31a3bd1fda0d810d6e33505 avoid to store unknown values for the sensor --- diff --git a/src/lib/cpu.c b/src/lib/cpu.c index b9065be..3388455 100644 --- a/src/lib/cpu.c +++ b/src/lib/cpu.c @@ -86,7 +86,12 @@ static double get_usage() void cpu_usage_sensor_update(struct psensor *s) { - psensor_set_current_value(s, get_usage()); + double v; + + v = get_usage(); + + if (v != UNKNOWN_DBL_VALUE) + psensor_set_current_value(s, v); } void cpu_psensor_list_update(struct psensor **sensors)