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

Unified Diff: runtime/bin/socket_android.cc

Issue 10823209: Add support for building the Dart VM for Android OS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporate review feedback from cshapiro 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
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) ||

Powered by Google App Engine
This is Rietveld 408576698