1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

unix, windows: return system error on EAI_SYSTEM

This commit is contained in:
Saúl Ibarra Corretgé 2014-06-16 10:09:45 +02:00
parent 90e4afd4fa
commit a098ac66dd
4 changed files with 2 additions and 5 deletions

View File

@ -39,7 +39,6 @@
#define UV__EAI_OVERFLOW (-3009)
#define UV__EAI_SERVICE (-3010)
#define UV__EAI_SOCKTYPE (-3011)
#define UV__EAI_SYSTEM (-3012) /* TODO(bnoordhuis) Return system error. */
#define UV__EAI_BADHINTS (-3013)
#define UV__EAI_PROTOCOL (-3014)

View File

@ -83,7 +83,6 @@ extern "C" {
XX(EAI_PROTOCOL, "resolved protocol is unknown") \
XX(EAI_SERVICE, "service not available for socket type") \
XX(EAI_SOCKTYPE, "socket type not supported") \
XX(EAI_SYSTEM, "system error") \
XX(EALREADY, "connection already in progress") \
XX(EBADF, "bad file descriptor") \
XX(EBUSY, "resource busy or locked") \

View File

@ -433,7 +433,7 @@ int uv__getaddrinfo_translate_error(int sys_err) {
case EAI_SOCKTYPE: return UV_EAI_SOCKTYPE;
#endif
#if defined(EAI_SYSTEM)
case EAI_SYSTEM: return UV_EAI_SYSTEM;
case EAI_SYSTEM: return -errno;
#endif
}
assert(!"unknown EAI_* error code");

View File

@ -113,8 +113,7 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* req) {
if (addrinfow_ptr->ai_canonname != NULL) {
name_len = uv_utf16_to_utf8(addrinfow_ptr->ai_canonname, -1, NULL, 0);
if (name_len == 0) {
/* FIXME(bnoordhuis) Retain GetLastError(). */
err = UV_EAI_SYSTEM;
err = uv_translate_sys_error(GetLastError());
goto complete;
}
addrinfo_len += ALIGNED_SIZE(name_len);