Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: runtime/bin/process_android.cc

Issue 12576007: Fix of file descriptor inheritance problem in process_{linux,android,mac} (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/process_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]));
« no previous file with comments | « no previous file | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698