From 70381cef9bcb7c306bf5204b7da9acdcf14ec74c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 30 Oct 2011 02:55:00 +0100 Subject: [PATCH] unix: add getaddrinfo compatibility hack Revisit in the future. This is not a good hack. --- src/unix/core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/unix/core.c b/src/unix/core.c index 0b81bc50..461d26fc 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -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; }