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

Unified Diff: runtime/bin/socket_macos.cc

Issue 907883002: Remove SetNonBlocking/SetBlocking methods from Socket and add missing close-on-exec (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 5 years, 10 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/socket_linux.cc ('k') | runtime/bin/socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_macos.cc
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index ffe0aeed679c83b217f2fe0357a7a15aaffac602..da659ff7fe8ac3a607edab9286930cff3caad85c 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -86,7 +86,7 @@ intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) {
return fd;
}
- Socket::SetNonBlocking(fd);
+ FDUtils::SetNonBlocking(fd);
return Socket::Connect(fd, addr, port);
}
@@ -298,7 +298,7 @@ intptr_t Socket::CreateBindDatagram(
return -1;
}
- Socket::SetNonBlocking(fd);
+ FDUtils::SetNonBlocking(fd);
return fd;
}
@@ -398,7 +398,7 @@ intptr_t ServerSocket::CreateBindListen(RawAddr addr,
return -1;
}
- Socket::SetNonBlocking(fd);
+ FDUtils::SetNonBlocking(fd);
return fd;
}
@@ -423,7 +423,8 @@ intptr_t ServerSocket::Accept(intptr_t fd) {
socket = kTemporaryFailure;
}
} else {
- Socket::SetNonBlocking(socket);
+ FDUtils::SetCloseOnExec(socket);
+ FDUtils::SetNonBlocking(socket);
}
return socket;
}
@@ -435,16 +436,6 @@ void Socket::Close(intptr_t fd) {
}
-bool Socket::SetNonBlocking(intptr_t fd) {
- return FDUtils::SetNonBlocking(fd);
-}
-
-
-bool Socket::SetBlocking(intptr_t fd) {
- return FDUtils::SetBlocking(fd);
-}
-
-
bool Socket::GetNoDelay(intptr_t fd, bool* enabled) {
int on;
socklen_t len = sizeof(on);
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698