Chromium Code Reviews| Index: runtime/bin/socket_android.cc |
| diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_android.cc |
| similarity index 96% |
| copy from runtime/bin/socket_linux.cc |
| copy to runtime/bin/socket_android.cc |
| index b126f5ddcc989c4238d737c0a250235ad92d9025..03544e455f8f04badc9ddb4a08ed1ae8b2c9140b 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) { |
|
cshapiro
2012/08/07 22:39:40
I am wondering how this should behave if there is
jackpal
2012/08/08 00:26:19
In my experience Android apps without the android.
|
| - int len = sizeof(errno); |
| + int errorNumber; |
| + int len = sizeof(errorNumber); |
| getsockopt(fd, |
| SOL_SOCKET, |
| SO_ERROR, |
| - &errno, |
| + reinterpret_cast<void*>(&errorNumber), |
| reinterpret_cast<socklen_t*>(&len)); |
| - os_error->SetCodeAndMessage(OSError::kSystem, errno); |
| + 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) || |