diff options
| author | 2020-06-05 18:17:22 +0000 | |
|---|---|---|
| committer | 2020-06-05 18:17:22 +0000 | |
| commit | 35a18b50c5d056e0ec2074db73525535e586709b (patch) | |
| tree | 2d4f916b7c52b6e2ab1a1b95b0208d83af7ab5a5 | |
| parent | 4757e8927746e5a576212d9364bfaa8276088b01 (diff) | |
| parent | 4686c24f53c20280026a8c22169c8a2daa9d4ecf (diff) | |
Merge "Fix a lambda capture problem in TextDumpsysSection" into rvc-dev
| -rw-r--r-- | cmds/incidentd/src/Section.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmds/incidentd/src/Section.cpp b/cmds/incidentd/src/Section.cpp index 61e5eb07130c..33e764988b75 100644 --- a/cmds/incidentd/src/Section.cpp +++ b/cmds/incidentd/src/Section.cpp @@ -477,14 +477,15 @@ status_t TextDumpsysSection::Execute(ReportWriter* writer) const { // Run dumping thread const uint64_t start = Nanotime(); - std::thread worker([&]() { + std::thread worker([write_fd = std::move(dumpPipe.writeFd()), service = std::move(service), + this]() mutable { // Don't crash the service if writing to a closed pipe (may happen if dumping times out) signal(SIGPIPE, sigpipe_handler); - status_t err = service->dump(dumpPipe.writeFd().get(), mArgs); + status_t err = service->dump(write_fd.get(), this->mArgs); if (err != OK) { ALOGW("[%s] dump thread failed. Error: %s", this->name.string(), strerror(-err)); } - dumpPipe.writeFd().reset(); + write_fd.reset(); }); // Collect dump content |