diff options
| author | 2018-05-02 20:58:14 +0000 | |
|---|---|---|
| committer | 2018-05-02 20:58:14 +0000 | |
| commit | ca6f36532d10bda2ce71d28b0ca2f40d99e1335c (patch) | |
| tree | e6121cbdce92d67d849a1ce1530b408250125fdd | |
| parent | 33540449fcb8e7a8f44602a77260261e5ff9cde1 (diff) | |
| parent | a8a56c8bd120dabfad492a8c6dbfcbefc3702559 (diff) | |
Merge "Preventing zombie process creation." into pi-dev
| -rw-r--r-- | cmds/incidentd/src/Section.cpp | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/cmds/incidentd/src/Section.cpp b/cmds/incidentd/src/Section.cpp index 93875cde4e24..0e72fc0768fd 100644 --- a/cmds/incidentd/src/Section.cpp +++ b/cmds/incidentd/src/Section.cpp @@ -902,11 +902,16 @@ status_t TombstoneSection::BlockingCall(int pipeWriteFd) const {          // Read from the pipe concurrently to avoid blocking the child.          FdBuffer buffer;          err = buffer.readFully(dumpPipe.readFd().get()); +        // Wait on the child to avoid it becoming a zombie process. +        status_t cStatus = wait_child(child);          if (err != NO_ERROR) {              ALOGW("TombstoneSection '%s' failed to read stack dump: %d", this->name.string(), err);              dumpPipe.readFd().reset();              break;          } +        if (cStatus != NO_ERROR) { +            ALOGE("TombstoneSection '%s' child had an issue: %s\n", this->name.string(), strerror(-cStatus)); +        }          auto dump = std::make_unique<char[]>(buffer.size());          auto iterator = buffer.data(); |