Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37af85d5 authored by Yifan Hong's avatar Yifan Hong
Browse files

Actually remove dead processes from lshal

Test: run lshal with and without the change

Change-Id: Id8c52a5be3253f5ff9c1cb851459a16e01ca5dda
Merged-In: Id8c52a5be3253f5ff9c1cb851459a16e01ca5dda
Fixes: 35765788
parent 3b3fbb7e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -68,9 +68,9 @@ const std::string &ListCommand::getCmdline(pid_t pid) {

void ListCommand::removeDeadProcesses(Pids *pids) {
    static const pid_t myPid = getpid();
    std::remove_if(pids->begin(), pids->end(), [this](auto pid) {
    pids->erase(std::remove_if(pids->begin(), pids->end(), [this](auto pid) {
        return pid == myPid || this->getCmdline(pid).empty();
    });
    }), pids->end());
}

bool ListCommand::getReferencedPids(