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

Unified Diff: runtime/bin/socket_android.cc

Issue 10907228: Use casts to work around bug in Android TEMP_FAILURE_RETRY macro (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « no previous file | no next file » | 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_android.cc b/runtime/bin/socket_android.cc
index ded8da622bc8c66bc3cc2799a75dd9f907a21fca..bac73c1e3dec23a425b4d7732d7adc8ec4880027 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -177,7 +177,12 @@ intptr_t ServerSocket::CreateBindListen(const char* host,
intptr_t fd;
struct sockaddr_in server_address;
- in_addr_t s_addr = TEMP_FAILURE_RETRY(inet_addr(host));
+ // Cast to/from int to work-around Android bug:
+ // http://code.google.com/p/android/issues/detail?id=37426
+ // unistd.h TEMP_FAILURE_RETRY generates warning when used with syscall that
+ // returns unsigned int.
+ in_addr_t s_addr = static_cast<in_addr_t>(
+ TEMP_FAILURE_RETRY(static_cast<int>(inet_addr(host))));
if (s_addr == INADDR_NONE) {
return -5;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698