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

Unified Diff: runtime/bin/socket_android.cc

Issue 2515643004: Fuchsia: Partial implementation of dart:io sockets (Closed)
Patch Set: Formatting Created 4 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/fdutils_macos.cc ('k') | runtime/bin/socket_fuchsia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_android.cc
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index 07e6894e6a8747995b3e17a35eec23b1a53436b4..ec1a43181a54199354459c3c5a24f6d4992efa32 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -25,7 +25,7 @@
namespace dart {
namespace bin {
-static void SaveErrorAndClose(intptr_t fd) {
+static void FDUtils::SaveErrorAndClose(intptr_t fd) {
int err = errno;
VOID_TEMP_FAILURE_RETRY(close(fd));
errno = err;
@@ -63,7 +63,7 @@ static intptr_t Create(const RawAddr& addr) {
return -1;
}
if (!FDUtils::SetCloseOnExec(fd)) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
return fd;
@@ -76,7 +76,7 @@ static intptr_t Connect(intptr_t fd, const RawAddr& addr) {
if ((result == 0) || (errno == EINPROGRESS)) {
return fd;
}
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
@@ -88,7 +88,7 @@ intptr_t Socket::CreateConnect(const RawAddr& addr) {
}
if (!FDUtils::SetNonBlocking(fd)) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
return Connect(fd, addr);
@@ -105,7 +105,7 @@ intptr_t Socket::CreateBindConnect(const RawAddr& addr,
intptr_t result = TEMP_FAILURE_RETRY(
bind(fd, &source_addr.addr, SocketAddress::GetAddrLength(source_addr)));
if ((result != 0) && (errno != EINPROGRESS)) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
@@ -323,7 +323,7 @@ intptr_t Socket::CreateBindDatagram(const RawAddr& addr, bool reuseAddress) {
}
if (!FDUtils::SetCloseOnExec(fd)) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
@@ -335,12 +335,12 @@ intptr_t Socket::CreateBindDatagram(const RawAddr& addr, bool reuseAddress) {
if (NO_RETRY_EXPECTED(
bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
if (!FDUtils::SetNonBlocking(fd)) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
return fd;
@@ -377,7 +377,7 @@ intptr_t ServerSocket::CreateBindListen(const RawAddr& addr,
}
if (!FDUtils::SetCloseOnExec(fd)) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
@@ -393,7 +393,7 @@ intptr_t ServerSocket::CreateBindListen(const RawAddr& addr,
if (NO_RETRY_EXPECTED(
bind(fd, &addr.addr, SocketAddress::GetAddrLength(addr))) < 0) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
@@ -403,17 +403,17 @@ intptr_t ServerSocket::CreateBindListen(const RawAddr& addr,
// Don't close the socket until we have created a new socket, ensuring
// that we do not get the bad port number again.
intptr_t new_fd = CreateBindListen(addr, backlog, v6_only);
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return new_fd;
}
if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
if (!FDUtils::SetNonBlocking(fd)) {
- SaveErrorAndClose(fd);
+ FDUtils::SaveErrorAndClose(fd);
return -1;
}
return fd;
@@ -451,11 +451,11 @@ intptr_t ServerSocket::Accept(intptr_t fd) {
}
} else {
if (!FDUtils::SetCloseOnExec(socket)) {
- SaveErrorAndClose(socket);
+ FDUtils::SaveErrorAndClose(socket);
return -1;
}
if (!FDUtils::SetNonBlocking(socket)) {
- SaveErrorAndClose(socket);
+ FDUtils::SaveErrorAndClose(socket);
return -1;
}
}
« no previous file with comments | « runtime/bin/fdutils_macos.cc ('k') | runtime/bin/socket_fuchsia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698