unix: add getaddrinfo compatibility hack

Revisit in the future. This is not a good hack.
This commit is contained in:
Ben Noordhuis 2011-10-30 02:55:00 +01:00
parent 84bc18684e
commit 70381cef9b

View File

@ -597,7 +597,11 @@ static int uv_getaddrinfo_done(eio_req* req) {
free(handle->service);
free(handle->hostname);
if (handle->retcode != 0) {
if (handle->retcode == 0) {
/* OK */
} else if (handle->retcode == EAI_NONAME || handle->retcode == EAI_NODATA) {
uv__set_sys_error(handle->loop, ENOENT); /* FIXME compatibility hack */
} else {
handle->loop->last_err.code = UV_EADDRINFO;
handle->loop->last_err.sys_errno_ = handle->retcode;
}