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

Unified Diff: runtime/bin/socket_android.cc

Issue 10826233: Add _android files for building DartVM on Android (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporate reviewer's feedback (asiva, Soren Gjesse) Created 8 years, 4 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_android.h ('k') | runtime/bin/utils_android.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_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) ||
« no previous file with comments | « runtime/bin/socket_android.h ('k') | runtime/bin/utils_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698