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

Unified Diff: runtime/bin/process_macos.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_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_macos.cc
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index 67a7102613fdac4ea9ab0e9ce843aef8e7b8c7e5..fb60ecd5fc9cdd1430812f89fa1e879ec93a2a62 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.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);
VOID_TEMP_FAILURE_RETRY(close(read_in[0]));
« no previous file with comments | « runtime/bin/process_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698