mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 15:55:07 +00:00
LibCore: Report error condition when reading process statistics failed
This commit is contained in:
parent
754bf22da7
commit
cf89180c35
12 changed files with 94 additions and 74 deletions
|
@ -147,10 +147,10 @@ private:
|
|||
idle = 0;
|
||||
|
||||
auto all_processes = Core::ProcessStatisticsReader::get_all();
|
||||
if (all_processes.is_empty())
|
||||
if (!all_processes.has_value() || all_processes.value().is_empty())
|
||||
return false;
|
||||
|
||||
for (auto& it : all_processes) {
|
||||
for (auto& it : all_processes.value()) {
|
||||
for (auto& jt : it.value.threads) {
|
||||
if (it.value.pid == 0)
|
||||
idle += jt.ticks_user + jt.ticks_kernel;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue