1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:57:35 +00:00

LibCore: Report error condition when reading process statistics failed

This commit is contained in:
Tom 2021-01-01 20:58:47 -07:00 committed by Andreas Kling
parent 754bf22da7
commit cf89180c35
12 changed files with 94 additions and 74 deletions

View file

@ -77,6 +77,10 @@ int main()
}
auto process_statistics = Core::ProcessStatisticsReader::get_all();
if (!process_statistics.has_value()) {
warnln("Error: Could not get process statistics");
return 1;
}
auto now = time(nullptr);
@ -110,7 +114,7 @@ int main()
String what = "n/a";
for (auto& it : process_statistics) {
for (auto& it : process_statistics.value()) {
if (it.value.tty == tty && it.value.pid == it.value.pgid)
what = it.value.name;
}