From: Michael Tremer Date: Sun, 26 Oct 2025 17:54:57 +0000 (+0000) Subject: sources: cpufreq: Disable source if there is no support X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f0b964a3bfab6ca5fcfdcda65e88fcfcc949933;p=telemetry.git sources: cpufreq: Disable source if there is no support Signed-off-by: Michael Tremer --- diff --git a/src/daemon/sources/cpufreq.c b/src/daemon/sources/cpufreq.c index d315bc1..94cd99d 100644 --- a/src/daemon/sources/cpufreq.c +++ b/src/daemon/sources/cpufreq.c @@ -86,8 +86,17 @@ static int cpufreq_heartbeat(td_ctx* ctx, td_source* source) { // Collect metrics for each available processor for (long i = 0; i < num; i++) { r = cpufreq_heartbeat_cpu(ctx, source, i); - if (r < 0) - return r; + if (r < 0) { + switch (-r) { + // We probably don't have cpufreq support + case ENOENT: + return td_source_disable(source); + + // Abort on any other errors + default: + return r; + } + } } return 0;