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

Unified Diff: runtime/bin/process_linux.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 | « runtime/bin/process_android.cc ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_linux.cc
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index 35223859ff6da1d3c785c231a4cf62f13f700570..9ff0ce71e9ac36b839754b356a64cf0538ad841e 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -336,6 +336,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) {
@@ -345,6 +346,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) {
@@ -356,6 +358,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) {
@@ -369,12 +372,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 | « runtime/bin/process_android.cc ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698