mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 12:44:34 +03:00
OpenBSD: support offline CPUs and hot-swapping
This commit is contained in:

committed by
Benny Baumann

parent
f608fc5c8a
commit
edf236f9fc
@ -169,19 +169,12 @@ int Platform_getMaxPid() {
|
||||
|
||||
double Platform_setCPUValues(Meter* this, unsigned int cpu) {
|
||||
const OpenBSDProcessList* pl = (const OpenBSDProcessList*) this->pl;
|
||||
const CPUData* cpuData = NULL;
|
||||
const CPUData* cpuData = &(pl->cpuData[cpu]);
|
||||
double total;
|
||||
double totalPercent;
|
||||
double* v = this->values;
|
||||
|
||||
for (unsigned int i = 0; i < pl->super.activeCPUs; i++) {
|
||||
if (pl->cpus[i].cpuIndex == cpu) {
|
||||
cpuData = &(pl->cpus[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cpuData) {
|
||||
if (!cpuData->online) {
|
||||
this->curItems = 0;
|
||||
return NAN;
|
||||
}
|
||||
|
Reference in New Issue
Block a user