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

Unified Diff: runtime/bin/socket_win.cc

Issue 11566007: Fix extraction of error messages on Windows from getaddrinfo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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_win.cc
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index 6e1a0bc94f02e86edfe7369d47cedad022e66942..adc6aef87ae7026ad3dabfa9f11e29ee513644c3 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -184,9 +184,9 @@ const char* Socket::LookupIPv4Address(char* host, OSError** os_error) {
int status = getaddrinfo(host, 0, &hints, &info);
if (status != 0) {
ASSERT(*os_error == NULL);
- *os_error = new OSError(status,
- gai_strerror(status),
- OSError::kGetAddressInfo);
+ DWORD error_code = WSAGetLastError();
+ SetLastError(error_code);
+ *os_error = new OSError();
return NULL;
}
// Convert the address into IPv4 dotted decimal notation.
« 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