windows: fix GetNameInfoW error handling
GetNameInfoW return non-zero on error, and not vice versa.
This commit is contained in:
parent
a669f21bf8
commit
7bdcf3dc7e
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user