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

Unified Diff: runtime/bin/process_macos.cc

Issue 11571056: Set close-on-exec flag on pipe() and kqueue() file descriptors on MacOS (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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/eventhandler_macos.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 6256b31b88b024290f41e22167e5f1db6baf7bd3..f2d5ca3a8ea7a170c0d6dec54b24b54828f2aacc 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -124,6 +124,8 @@ class ExitCodeHandler {
if (result < 0) {
return false;
}
+ FDUtils::SetCloseOnExec(sig_chld_fds_[0]);
+ FDUtils::SetCloseOnExec(sig_chld_fds_[1]);
// Start thread that polls the pipe and handles process exits when
// data is received on the pipe.
@@ -480,6 +482,8 @@ int Process::Start(const char* path,
Log::PrintErr("Error pipe creation failed: %s\n", *os_error_message);
return errno;
}
+ FDUtils::SetCloseOnExec(event_fds[0]);
+ FDUtils::SetCloseOnExec(event_fds[1]);
ProcessInfoList::AddProcess(pid, event_fds[1]);
*exit_event = event_fds[0];
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698