ext/libuv/src/win/getnameinfo.c in libuv-1.0.3 vs ext/libuv/src/win/getnameinfo.c in libuv-1.1.0
- old
+ new
@@ -44,16 +44,18 @@
WCHAR host[NI_MAXHOST];
WCHAR service[NI_MAXSERV];
int ret = 0;
req = container_of(w, uv_getnameinfo_t, work_req);
- ret = GetNameInfoW((struct sockaddr*)&req->storage,
- sizeof(req->storage),
- host,
- ARRAY_SIZE(host),
- service,
- ARRAY_SIZE(service),
- req->flags);
+ if (GetNameInfoW((struct sockaddr*)&req->storage,
+ sizeof(req->storage),
+ host,
+ ARRAY_SIZE(host),
+ service,
+ ARRAY_SIZE(service),
+ req->flags)) {
+ ret = WSAGetLastError();
+ }
req->retcode = uv__getaddrinfo_translate_error(ret);
/* convert results to UTF-8 */
WideCharToMultiByte(CP_UTF8,
0,