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:
parent
90e4afd4fa
commit
a098ac66dd
@ -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)
|
||||
|
||||
|
@ -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") \
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user