diff options
author | Brad King <brad.king@kitware.com> | 2019-06-18 11:45:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-18 11:45:53 (GMT) |
commit | 69b139cfca6c5eef64558070f533b6c898f410e0 (patch) | |
tree | 12d281e91cc1f71c56e2e1372589085df4df8265 /Utilities/cmlibuv/src/win/tcp.c | |
parent | ab63072381171e9c5a7164536f0912b8b3a4a313 (diff) | |
parent | b4069b04ff63b327ff4881282200c3c73fded34d (diff) | |
download | CMake-69b139cfca6c5eef64558070f533b6c898f410e0.zip CMake-69b139cfca6c5eef64558070f533b6c898f410e0.tar.gz CMake-69b139cfca6c5eef64558070f533b6c898f410e0.tar.bz2 |
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
libuv 2019-06-10 (ee24ce90)
Diffstat (limited to 'Utilities/cmlibuv/src/win/tcp.c')
-rw-r--r-- | Utilities/cmlibuv/src/win/tcp.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/Utilities/cmlibuv/src/win/tcp.c b/Utilities/cmlibuv/src/win/tcp.c index 3ce5548..f2cb527 100644 --- a/Utilities/cmlibuv/src/win/tcp.c +++ b/Utilities/cmlibuv/src/win/tcp.c @@ -809,44 +809,24 @@ static int uv_tcp_try_connect(uv_connect_t* req, int uv_tcp_getsockname(const uv_tcp_t* handle, struct sockaddr* name, int* namelen) { - int result; - - if (handle->socket == INVALID_SOCKET) { - return UV_EINVAL; - } - - if (handle->delayed_error) { - return uv_translate_sys_error(handle->delayed_error); - } - - result = getsockname(handle->socket, name, namelen); - if (result != 0) { - return uv_translate_sys_error(WSAGetLastError()); - } - return 0; + return uv__getsockpeername((const uv_handle_t*) handle, + getsockname, + name, + namelen, + handle->delayed_error); } int uv_tcp_getpeername(const uv_tcp_t* handle, struct sockaddr* name, int* namelen) { - int result; - - if (handle->socket == INVALID_SOCKET) { - return UV_EINVAL; - } - - if (handle->delayed_error) { - return uv_translate_sys_error(handle->delayed_error); - } - - result = getpeername(handle->socket, name, namelen); - if (result != 0) { - return uv_translate_sys_error(WSAGetLastError()); - } - return 0; + return uv__getsockpeername((const uv_handle_t*) handle, + getpeername, + name, + namelen, + handle->delayed_error); } |