mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
LibCore: Use Core::Stream
for ProcessStatisticsReader
This commit is contained in:
parent
e338a0656d
commit
8940f2da7f
18 changed files with 55 additions and 95 deletions
|
@ -18,11 +18,9 @@ static ErrorOr<int> pid_of(DeprecatedString const& process_name, bool single_sho
|
|||
{
|
||||
bool displayed_at_least_one = false;
|
||||
|
||||
auto all_processes = Core::ProcessStatisticsReader::get_all();
|
||||
if (!all_processes.has_value())
|
||||
return 1;
|
||||
auto all_processes = TRY(Core::ProcessStatisticsReader::get_all());
|
||||
|
||||
for (auto& it : all_processes.value().processes) {
|
||||
for (auto& it : all_processes.processes) {
|
||||
if (it.name == process_name) {
|
||||
if (!omit_pid || it.pid != pid) {
|
||||
out(displayed_at_least_one ? " {}"sv : "{}"sv, it.pid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue