From 02cfd38671ab122b87d2443b24cc6a2440cbc3b9 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 10 Aug 2021 13:58:55 +1000 Subject: [PATCH] The average CPU utilization value must never be marked 'offline' Fixes https://github.com/htop-dev/htop/issues/729 --- linux/LinuxProcessList.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index d3463b51..3556669d 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -171,7 +171,7 @@ static void LinuxProcessList_updateCPUcount(ProcessList* super) { super->activeCPUs = 1; super->existingCPUs = 1; this->cpuData = xReallocArray(this->cpuData, 2, sizeof(CPUData)); - this->cpuData[0].online = true; + this->cpuData[0].online = true; /* average is always "online" */ this->cpuData[1].online = true; return; } @@ -209,6 +209,7 @@ static void LinuxProcessList_updateCPUcount(ProcessList* super) { for (unsigned int j = currExisting; j < max; j++) { this->cpuData[j].online = false; } + this->cpuData[0].online = true; /* average is always "online" */ currExisting = max; }