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

Commit 7ce6453a authored by Bart Van Assche's avatar Bart Van Assche
Browse files

init: Fix a bug in the WaitToBeReaped() logging code



Only report status information for the processes that are still running.
Additionally, make the logging output look better by starting the
process information from /proc start on a new line.

Fixes: ea595ba2 ("init: Log more information if stopping times out")
Change-Id: I3c882c364f11278087a78efb7a8e8fee8e582417
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 48440920
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -139,10 +139,10 @@ void WaitToBeReaped(const std::vector<pid_t>& pids, std::chrono::milliseconds ti
    }
    LOG(INFO) << "Waiting for " << pids.size() << " pids to be reaped took " << t << " with "
              << alive_pids.size() << " of them still running";
    for (pid_t pid : pids) {
    for (pid_t pid : alive_pids) {
        std::string status = "(no-such-pid)";
        ReadFileToString(StringPrintf("/proc/%d/status", pid), &status);
        LOG(INFO) << "Still running: " << pid << ' ' << status;
        LOG(INFO) << "Still running: " << pid << '\n' << status;
    }
}