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

Unified Diff: runtime/bin/eventhandler_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 | « no previous file | 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/eventhandler_macos.cc
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index 3954190ffaf7845a6e82894d43aa39b834381efd..51f1e70bba0705edac949befb45e35400eb02467 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -123,6 +123,8 @@ EventHandlerImplementation::EventHandlerImplementation()
FATAL("Pipe creation failed");
}
FDUtils::SetNonBlocking(interrupt_fds_[0]);
+ FDUtils::SetCloseOnExec(interrupt_fds_[0]);
+ FDUtils::SetCloseOnExec(interrupt_fds_[1]);
timeout_ = kInfinityTimeout;
timeout_port_ = 0;
shutdown_ = false;
@@ -131,6 +133,7 @@ EventHandlerImplementation::EventHandlerImplementation()
if (kqueue_fd_ == -1) {
FATAL("Failed creating kqueue");
}
+ FDUtils::SetCloseOnExec(kqueue_fd_);
// Register the interrupt_fd with the kqueue.
struct kevent event;
EV_SET(&event, interrupt_fds_[0], EVFILT_READ, EV_ADD, 0, 0, NULL);
« no previous file with comments | « no previous file | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698