Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Map EAI_NONAME to ENOENT
  • Loading branch information
ry committed Oct 21, 2011
1 parent 28234d7 commit 2c7e8bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/uv.h
Expand Up @@ -865,6 +865,8 @@ struct uv_getaddrinfo_s {
*
* uv_freeaddrinfo() must be called after completion to free the addrinfo
* structure.
*
* On error NXDOMAIN the status code will be non-zero and UV_ENOENT returned.
*/
int uv_getaddrinfo(uv_loop_t*,
uv_getaddrinfo_t* handle,
Expand Down
1 change: 1 addition & 0 deletions src/unix/error.c
Expand Up @@ -103,6 +103,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ENOTDIR: return UV_ENOTDIR;
case ENOTCONN: return UV_ENOTCONN;
case EEXIST: return UV_EEXIST;
case EAI_NONAME: return UV_ENOENT;

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Nov 7, 2011

Contributor

This looks like it could report the wrong error on some platforms. EAI_NONAME equals ENOEXEC on sunos, for example.

default: return UV_UNKNOWN;
}

Expand Down
1 change: 1 addition & 0 deletions src/win/error.c
Expand Up @@ -129,6 +129,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_PIPE_BUSY: return UV_EBUSY;
case ERROR_SEM_TIMEOUT: return UV_ETIMEDOUT;
case ERROR_ALREADY_EXISTS: return UV_EEXIST;
case WSAHOST_NOT_FOUND: return UV_ENOENT;
default: return UV_UNKNOWN;
}
}
Expand Down

0 comments on commit 2c7e8bb

Please sign in to comment.