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

Unified Diff: runtime/bin/socket_linux.cc

Issue 11416006: Added FD_CLOEXEC flag to client/server socket file descriptors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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/socket_android.cc ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_linux.cc
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index 896a9da069497bda67f02e03bc55b4a6831ebaf8..89dd267b6dace61675b6fb74c15b92b97fe54e1e 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -29,6 +29,7 @@ intptr_t Socket::CreateConnect(const char* host, const intptr_t port) {
return -1;
}
+ FDUtils::SetCloseOnExec(fd);
FDUtils::SetNonBlocking(fd);
static const size_t kTempBufSize = 1024;
@@ -191,6 +192,8 @@ intptr_t ServerSocket::CreateBindListen(const char* host,
return -1;
}
+ FDUtils::SetCloseOnExec(fd);
+
int optval = 1;
TEMP_FAILURE_RETRY(
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)));
« no previous file with comments | « runtime/bin/socket_android.cc ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698