windows: use WSAGetLastError(), not errno
setsockopt() doesn't touch errno on failure. Use WSAGetLastError() instead.
This commit is contained in:
parent
92040eb712
commit
30a8b44c4c
@ -50,7 +50,7 @@ static int uv__tcp_nodelay(uv_tcp_t* handle, SOCKET socket, int enable) {
|
|||||||
TCP_NODELAY,
|
TCP_NODELAY,
|
||||||
(const char*)&enable,
|
(const char*)&enable,
|
||||||
sizeof enable) == -1) {
|
sizeof enable) == -1) {
|
||||||
uv__set_sys_error(handle->loop, errno);
|
uv__set_sys_error(handle->loop, WSAGetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -63,7 +63,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
|
|||||||
SO_KEEPALIVE,
|
SO_KEEPALIVE,
|
||||||
(const char*)&enable,
|
(const char*)&enable,
|
||||||
sizeof enable) == -1) {
|
sizeof enable) == -1) {
|
||||||
uv__set_sys_error(handle->loop, errno);
|
uv__set_sys_error(handle->loop, WSAGetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
|
|||||||
TCP_KEEPALIVE,
|
TCP_KEEPALIVE,
|
||||||
(const char*)&delay,
|
(const char*)&delay,
|
||||||
sizeof delay) == -1) {
|
sizeof delay) == -1) {
|
||||||
uv__set_sys_error(handle->loop, errno);
|
uv__set_sys_error(handle->loop, WSAGetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user