diff options
author | 2017-05-12 16:33:57 -0700 | |
---|---|---|
committer | 2017-05-15 11:27:39 -0700 | |
commit | 37af85d546b9f0c5198dfdc34e0082b9bf5a37b5 (patch) | |
tree | faf44f55892d49ed97dc89e667e0b713485d444c | |
parent | 3b3fbb7e23140e87f9f85d7ce82daeef82dde1e1 (diff) |
Actually remove dead processes from lshal
Test: run lshal with and without the change
Change-Id: Id8c52a5be3253f5ff9c1cb851459a16e01ca5dda
Merged-In: Id8c52a5be3253f5ff9c1cb851459a16e01ca5dda
Fixes: 35765788
-rw-r--r-- | cmds/lshal/ListCommand.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/lshal/ListCommand.cpp b/cmds/lshal/ListCommand.cpp index fe2a7ca5c1..710b6e4c84 100644 --- a/cmds/lshal/ListCommand.cpp +++ b/cmds/lshal/ListCommand.cpp @@ -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( |