mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
LibCore: Make ProcessStatisticsReader return results in a Vector
The HashMap API was overkill and made using this less ergonomic than it should be.
This commit is contained in:
parent
a345a1f4a1
commit
a1e133cc6b
12 changed files with 79 additions and 83 deletions
|
@ -20,13 +20,13 @@ static void print_usage_and_exit()
|
|||
|
||||
static int kill_all(const String& process_name, const unsigned signum)
|
||||
{
|
||||
auto processes = Core::ProcessStatisticsReader().get_all();
|
||||
auto processes = Core::ProcessStatisticsReader::get_all();
|
||||
if (!processes.has_value())
|
||||
return 1;
|
||||
|
||||
for (auto& it : processes.value()) {
|
||||
if (it.value.name == process_name) {
|
||||
int ret = kill(it.value.pid, signum);
|
||||
for (auto& process : processes.value()) {
|
||||
if (process.name == process_name) {
|
||||
int ret = kill(process.pid, signum);
|
||||
if (ret < 0)
|
||||
perror("kill");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue