Index: runtime/bin/socket_android.cc |
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_android.cc |
similarity index 95% |
copy from runtime/bin/socket_linux.cc |
copy to runtime/bin/socket_android.cc |
index b126f5ddcc989c4238d737c0a250235ad92d9025..8a57d014c7ccfc227d507274a55de4385e0fcc7e 100644 |
--- a/runtime/bin/socket_linux.cc |
+++ b/runtime/bin/socket_android.cc |
@@ -13,7 +13,7 @@ |
bool Socket::Initialize() { |
- // Nothing to do on Linux. |
+ // Nothing to do on Android. |
return true; |
} |
@@ -123,13 +123,14 @@ bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) { |
void Socket::GetError(intptr_t fd, OSError* os_error) { |
- int len = sizeof(errno); |
+ int errorNumber; |
+ socklen_t len = sizeof(errorNumber); |
getsockopt(fd, |
SOL_SOCKET, |
SO_ERROR, |
- &errno, |
- reinterpret_cast<socklen_t*>(&len)); |
- os_error->SetCodeAndMessage(OSError::kSystem, errno); |
+ reinterpret_cast<void*>(&errorNumber), |
+ &len); |
+ os_error->SetCodeAndMessage(OSError::kSystem, errorNumber); |
} |
@@ -211,7 +212,7 @@ intptr_t ServerSocket::CreateBindListen(const char* host, |
static bool IsTemporaryAcceptError(int error) { |
- // On Linux a number of protocol errors should be treated as EAGAIN. |
+ // On Android a number of protocol errors should be treated as EAGAIN. |
// These are the ones for TCP/IP. |
return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) || |
(error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) || |