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

Unified Diff: runtime/bin/socket_linux.cc

Issue 257153002: Use accept and not accept4. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | 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 e650c681ed24535b9958c0ca63d0b16752614530..eec3c609f2e9e9dbd31b8be22f564011e4060d07 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -420,8 +420,7 @@ intptr_t ServerSocket::Accept(intptr_t fd) {
intptr_t socket;
struct sockaddr clientaddr;
socklen_t addrlen = sizeof(clientaddr);
- socket = TEMP_FAILURE_RETRY(accept4(
- fd, &clientaddr, &addrlen, SOCK_NONBLOCK | SOCK_CLOEXEC));
+ socket = TEMP_FAILURE_RETRY(accept(fd, &clientaddr, &addrlen));
if (socket == -1) {
if (IsTemporaryAcceptError(errno)) {
// We need to signal to the caller that this is actually not an
@@ -430,6 +429,9 @@ intptr_t ServerSocket::Accept(intptr_t fd) {
ASSERT(kTemporaryFailure != -1);
socket = kTemporaryFailure;
}
+ } else {
+ FDUtils::SetNonBlocking(socket);
+ FDUtils::SetCloseOnExec(socket);
}
return socket;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698