| Index: runtime/bin/process_android.cc
|
| diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc
|
| index 066539a2eeaa123daf7766671541adc3dc9e41ce..f0bbb836bf0d381490295af54ffcb54a535a8cae 100644
|
| --- a/runtime/bin/process_android.cc
|
| +++ b/runtime/bin/process_android.cc
|
| @@ -334,6 +334,7 @@ int Process::Start(const char* path,
|
| Log::PrintErr("Error pipe creation failed: %s\n", *os_error_message);
|
| return errno;
|
| }
|
| + FDUtils::SetCloseOnExec(read_in[0]);
|
|
|
| result = TEMP_FAILURE_RETRY(pipe(read_err));
|
| if (result < 0) {
|
| @@ -343,6 +344,7 @@ int Process::Start(const char* path,
|
| Log::PrintErr("Error pipe creation failed: %s\n", *os_error_message);
|
| return errno;
|
| }
|
| + FDUtils::SetCloseOnExec(read_err[0]);
|
|
|
| result = TEMP_FAILURE_RETRY(pipe(write_out));
|
| if (result < 0) {
|
| @@ -354,6 +356,7 @@ int Process::Start(const char* path,
|
| Log::PrintErr("Error pipe creation failed: %s\n", *os_error_message);
|
| return errno;
|
| }
|
| + FDUtils::SetCloseOnExec(write_out[1]);
|
|
|
| result = TEMP_FAILURE_RETRY(pipe(exec_control));
|
| if (result < 0) {
|
| @@ -367,12 +370,9 @@ int Process::Start(const char* path,
|
| Log::PrintErr("Error pipe creation failed: %s\n", *os_error_message);
|
| return errno;
|
| }
|
| + FDUtils::SetCloseOnExec(exec_control[0]);
|
| + FDUtils::SetCloseOnExec(exec_control[1]);
|
|
|
| - // Set close on exec on the write file descriptor of the exec control pipe.
|
| - result = TEMP_FAILURE_RETRY(
|
| - fcntl(exec_control[1],
|
| - F_SETFD,
|
| - TEMP_FAILURE_RETRY(fcntl(exec_control[1], F_GETFD)) | FD_CLOEXEC));
|
| if (result < 0) {
|
| SetChildOsErrorMessage(os_error_message);
|
| TEMP_FAILURE_RETRY(close(read_in[0]));
|
|
|