1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17: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

@ -41,8 +41,10 @@ static void print_usage_and_exit()
static int kill_all(const String& process_name, const unsigned signum)
{
auto processes = Core::ProcessStatisticsReader().get_all();
if (!processes.has_value())
return 1;
for (auto& it : processes) {
for (auto& it : processes.value()) {
if (it.value.name == process_name) {
int ret = kill(it.value.pid, signum);
if (ret < 0)