Index: dart/runtime/bin/socket_macos.cc |
=================================================================== |
--- dart/runtime/bin/socket_macos.cc (revision 29908) |
+++ dart/runtime/bin/socket_macos.cc (working copy) |
@@ -137,7 +137,7 @@ |
} |
-bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) { |
+SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) { |
ASSERT(fd >= 0); |
RawAddr raw; |
socklen_t size = sizeof(raw); |
@@ -149,23 +149,10 @@ |
char error_message[kBufferSize]; |
strerror_r(errno, error_message, kBufferSize); |
Log::PrintErr("Error getpeername: %s\n", error_message); |
- return false; |
+ return NULL; |
} |
- if (TEMP_FAILURE_RETRY(getnameinfo(&raw.addr, |
- size, |
- host, |
- INET6_ADDRSTRLEN, |
- NULL, |
- 0, |
- NI_NUMERICHOST)) != 0) { |
- const int kBufferSize = 1024; |
- char error_message[kBufferSize]; |
- strerror_r(errno, error_message, kBufferSize); |
- Log::PrintErr("Error getnameinfo: %s\n", error_message); |
- return false; |
- } |
*port = SocketAddress::GetAddrPort(&raw); |
- return true; |
+ return new SocketAddress(&raw.addr); |
} |