Index: runtime/bin/socket_linux.cc |
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc |
index b9431e17ee64e1f3369f1b2f8523cd2061c8808a..c3c01cc89c9978be867b0511786a3d9083ff3cf9 100644 |
--- a/runtime/bin/socket_linux.cc |
+++ b/runtime/bin/socket_linux.cc |
@@ -137,7 +137,7 @@ intptr_t Socket::GetPort(intptr_t fd) { |
} |
-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 @@ bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) { |
char error_buf[kBufferSize]; |
Log::PrintErr("Error getpeername: %s\n", |
strerror_r(errno, error_buf, kBufferSize)); |
- return false; |
- } |
- if (TEMP_FAILURE_RETRY(getnameinfo(&raw.addr, |
- size, |
- host, |
- INET6_ADDRSTRLEN, |
- NULL, |
- 0, |
- NI_NUMERICHOST)) != 0) { |
- const int kBufferSize = 1024; |
- char error_buf[kBufferSize]; |
- Log::PrintErr("Error getnameinfo: %s\n", |
- strerror_r(errno, error_buf, kBufferSize)); |
- return false; |
+ return NULL; |
} |
*port = SocketAddress::GetAddrPort(&raw); |
- return true; |
+ return new SocketAddress(&raw.addr); |
} |