windows: fix GetNameInfoW error handling

GetNameInfoW return non-zero on error, and not vice versa.
This commit is contained in:
Alexis Campailla 2014-08-12 16:28:46 +02:00 committed by Saúl Ibarra Corretgé
parent a669f21bf8
commit 7bdcf3dc7e

View File

@ -46,13 +46,13 @@ static void uv__getnameinfo_work(struct uv__work* w) {
int ret = 0;
req = container_of(w, uv_getnameinfo_t, work_req);
if (!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);