Skip to content

Commit

Permalink
windows: fix GetNameInfoW error handling
Browse files Browse the repository at this point in the history
GetNameInfoW return non-zero on error, and not vice versa.
  • Loading branch information
orangemocha authored and saghul committed Aug 12, 2014
1 parent a669f21 commit 7bdcf3d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/win/getnameinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7bdcf3d

Please sign in to comment.