diff --git a/haiku-apps/systeminfo/patches/systeminfo-2-2.patchset b/haiku-apps/systeminfo/patches/systeminfo-2-2.patchset new file mode 100644 index 000000000..69ce09887 --- /dev/null +++ b/haiku-apps/systeminfo/patches/systeminfo-2-2.patchset @@ -0,0 +1,41 @@ +From d0ea409005cecef76c6fcb7a0cefd0a662d340e0 Mon Sep 17 00:00:00 2001 +From: Chirayu Desai +Date: Wed, 3 Dec 2014 19:50:33 +0000 +Subject: [PATCH] CPUPercent: Update for new API + +--- + CPUPercent.cpp | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/CPUPercent.cpp b/CPUPercent.cpp +index 3e4c8e8931..4225f73642 100644 +--- a/CPUPercent.cpp ++++ b/CPUPercent.cpp +@@ -19,17 +19,22 @@ void CPU_Percent::Update() + { + system_info info; + get_system_info(&info); ++ ++ cpu_info* cpuInfos = new cpu_info[info.cpu_count]; ++ get_cpu_info(0, info.cpu_count, cpuInfos); + + delta_system = (double)system_time() - last_system_time; +- delta_cpu = double(info.cpu_infos[theCPU].active_time) - last_active_cpu_time; ++ delta_cpu = double(cpuInfos[theCPU].active_time) - last_active_cpu_time; + + percent = (delta_cpu/delta_system); + if(percent < 0) percent = 0.00; + if(percent > 1) percent = 1.00; + + lastpercent = percent; +- last_active_cpu_time = (double)info.cpu_infos[theCPU].active_time; ++ last_active_cpu_time = (double)cpuInfos[theCPU].active_time; + last_system_time = (double)system_time(); ++ ++ delete[] cpuInfos; + } + + double CPU_Percent::Percentage() +-- +1.8.3.4 + diff --git a/haiku-apps/systeminfo/systeminfo-2.recipe b/haiku-apps/systeminfo/systeminfo-2.recipe index 400e28d81..0158096eb 100644 --- a/haiku-apps/systeminfo/systeminfo-2.recipe +++ b/haiku-apps/systeminfo/systeminfo-2.recipe @@ -37,6 +37,10 @@ BUILD_PREREQUIRES=" cmd:xres " +PATCHES=" + systeminfo-2-2.patchset +" + BUILD() { echo "const uint32 CP_CHANGE_BG = 'CPBG'; const uint32 CP_CHANGE_FG = 'CPFG';" > ./DigitalView.h