mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibCore: Use Core::Stream
for ProcessStatisticsReader
This commit is contained in:
parent
e338a0656d
commit
8940f2da7f
Notes:
sideshowbarker
2024-07-17 03:30:05 +09:00
Author: https://github.com/timschumi
Commit: 8940f2da7f
Pull-request: https://github.com/SerenityOS/serenity/pull/16379
Reviewed-by: https://github.com/davidot ✅
18 changed files with 55 additions and 95 deletions
|
@ -58,11 +58,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
HashMap<pid_t, DeprecatedString> programs;
|
||||
|
||||
if (flag_program) {
|
||||
auto processes = Core::ProcessStatisticsReader::get_all();
|
||||
if (!processes.has_value())
|
||||
return 1;
|
||||
auto processes = TRY(Core::ProcessStatisticsReader::get_all());
|
||||
|
||||
for (auto& proc : processes.value().processes) {
|
||||
for (auto& proc : processes.processes) {
|
||||
programs.set(proc.pid, proc.name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue