Commit 8208a151 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Fix off-by-one for cpuCount on Linux

cpuCount is based on cpu indices, which means we will be one lower than
the actual CPU count. So correct for that.

BUG: 435062
FIXED-IN: 5.22
parent fcd6a30d
......@@ -62,6 +62,10 @@ LinuxCpuPluginPrivate::LinuxCpuPluginPrivate(CpuPlugin *q)
cpuCount = std::max(cpuCount, info.cpu);
// cpuCount is based on the indices of the cpus, which means it is off by
// one compared to the actual number of CPUs. Correct that here.
cpuCount += 1;
QHash<int, int> numCores;
for (const auto &entry : qAsConst(cpus)) {
const QString name = cpuCount > 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment