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

Commit

Permalink
windows: use WSAGetLastError(), not errno
Browse files Browse the repository at this point in the history
setsockopt() doesn't touch errno on failure. Use WSAGetLastError()
instead.
  • Loading branch information
bnoordhuis committed Jun 25, 2013
1 parent 92040eb commit 30a8b44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/win/tcp.c
Expand Up @@ -50,7 +50,7 @@ static int uv__tcp_nodelay(uv_tcp_t* handle, SOCKET socket, int enable) {
TCP_NODELAY,
(const char*)&enable,
sizeof enable) == -1) {
uv__set_sys_error(handle->loop, errno);
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
}
return 0;
Expand All @@ -63,7 +63,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
SO_KEEPALIVE,
(const char*)&enable,
sizeof enable) == -1) {
uv__set_sys_error(handle->loop, errno);
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
}

Expand All @@ -72,7 +72,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
TCP_KEEPALIVE,
(const char*)&delay,
sizeof delay) == -1) {
uv__set_sys_error(handle->loop, errno);
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
}

Expand Down

0 comments on commit 30a8b44

Please sign in to comment.