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

Unified Diff: runtime/bin/socket_android.cc

Issue 14139032: Fix broken Mac OS socket code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « runtime/bin/socket.h ('k') | runtime/bin/socket_linux.cc » ('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 889015631788968fb692079281a484c70ff11df1..70eef7a885d70f04d9189f10e2039718fefec849 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -40,7 +40,7 @@ bool Socket::Initialize() {
intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) {
intptr_t fd;
- fd = TEMP_FAILURE_RETRY(socket(addr.ss_family, SOCK_STREAM, 0));
+ fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
if (fd < 0) {
Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
return -1;
@@ -120,12 +120,12 @@ bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
return false;
}
const void* src;
- if (raw.ss_family == AF_INET6) {
+ if (raw.ss.ss_family == AF_INET6) {
src = reinterpret_cast<const void*>(&raw.in6.sin6_addr);
} else {
src = reinterpret_cast<const void*>(&raw.in.sin_addr);
}
- if (inet_ntop(raw.ss_family,
+ if (inet_ntop(raw.ss.ss_family,
src,
host,
INET_ADDRSTRLEN) == NULL) {
@@ -195,7 +195,7 @@ intptr_t ServerSocket::CreateBindListen(RawAddr addr,
intptr_t backlog) {
intptr_t fd;
- fd = TEMP_FAILURE_RETRY(socket(addr.ss_family, SOCK_STREAM, 0));
+ fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
if (fd < 0) return -1;
FDUtils::SetCloseOnExec(fd);
@@ -204,7 +204,7 @@ intptr_t ServerSocket::CreateBindListen(RawAddr addr,
TEMP_FAILURE_RETRY(
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)));
- if (addr.ss_family == AF_INET6) {
+ if (addr.ss.ss_family == AF_INET6) {
optval = 0;
TEMP_FAILURE_RETRY(
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
« no previous file with comments | « runtime/bin/socket.h ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698