ext/libuv/src/unix/getaddrinfo.c in libuv-4.0.1 vs ext/libuv/src/unix/getaddrinfo.c in libuv-4.0.2

- old
+ new

@@ -84,11 +84,11 @@ #endif #if defined(EAI_SOCKTYPE) case EAI_SOCKTYPE: return UV_EAI_SOCKTYPE; #endif #if defined(EAI_SYSTEM) - case EAI_SYSTEM: return UV__ERR(errno); + case EAI_SYSTEM: return -errno; #endif } assert(!"unknown EAI_* error code"); abort(); return 0; /* Pacify compiler. */ @@ -123,11 +123,11 @@ req->hints = NULL; req->service = NULL; req->hostname = NULL; - if (status == UV_ECANCELED) { + if (status == -ECANCELED) { assert(req->retcode == 0); req->retcode = UV_EAI_CANCELED; } if (req->cb) @@ -146,19 +146,19 @@ size_t hints_len; size_t len; char* buf; if (req == NULL || (hostname == NULL && service == NULL)) - return UV_EINVAL; + return -EINVAL; hostname_len = hostname ? strlen(hostname) + 1 : 0; service_len = service ? strlen(service) + 1 : 0; hints_len = hints ? sizeof(*hints) : 0; buf = uv__malloc(hostname_len + service_len + hints_len); if (buf == NULL) - return UV_ENOMEM; + return -ENOMEM; uv__req_init(loop, req, UV_GETADDRINFO); req->loop = loop; req->cb = cb; req->addrinfo = NULL; @@ -209,10 +209,10 @@ if (buffer == NULL || size == NULL || *size == 0) return UV_EINVAL; if (if_indextoname(ifindex, ifname_buf) == NULL) - return UV__ERR(errno); + return -errno; len = strnlen(ifname_buf, sizeof(ifname_buf)); if (*size <= len) { *size = len + 1;