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

LibCore: Use Core::Stream for ProcessStatisticsReader

This commit is contained in:
Tim Schumacher 2022-12-08 14:50:31 +01:00 committed by Linus Groh
parent e338a0656d
commit 8940f2da7f
18 changed files with 55 additions and 95 deletions

View file

@ -33,11 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
return 1;
}
auto process_statistics = Core::ProcessStatisticsReader::get_all();
if (!process_statistics.has_value()) {
warnln("Error: Could not get process statistics");
return 1;
}
auto process_statistics = TRY(Core::ProcessStatisticsReader::get_all());
auto now = time(nullptr);
@ -70,7 +66,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
DeprecatedString what = "n/a";
for (auto& process : process_statistics.value().processes) {
for (auto& process : process_statistics.processes) {
if (process.tty == tty && process.pid == process.pgid)
what = process.name;
}