| Index: runtime/bin/process_linux.cc
|
| diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
|
| index 595861f2c174ecb15c5be89c1d1a42a2b201f4ab..5e7e838cba95739646e9f80cd3b24d531d0a5d33 100644
|
| --- a/runtime/bin/process_linux.cc
|
| +++ b/runtime/bin/process_linux.cc
|
| @@ -638,7 +638,8 @@ bool Process::Wait(intptr_t pid,
|
| }
|
|
|
| // Process incoming data.
|
| - for (int i = 0; i < alive; i++) {
|
| + int current_alive = alive;
|
| + for (int i = 0; i < current_alive; i++) {
|
| if (fds[i].revents & POLLIN) {
|
| intptr_t avail = FDUtils::AvailableBytes(fds[i].fd);
|
| if (fds[i].fd == out) {
|
| @@ -661,10 +662,6 @@ bool Process::Wait(intptr_t pid,
|
| UNREACHABLE();
|
| }
|
| }
|
| - }
|
| -
|
| - // Process closed.
|
| - for (int i = 0; i < alive; i++) {
|
| if (fds[i].revents & POLLHUP) {
|
| VOID_TEMP_FAILURE_RETRY(close(fds[i].fd));
|
| alive--;
|
|
|