Commit 1d7d5732 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ws2_32: Implement getsockopt(SO_DONTLINGER) on top of Win32 getsockopt(SO_LINGER).

parent 130b5496
......@@ -2162,29 +2162,21 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
case WS_SO_DONTLINGER:
{
struct linger lingval;
socklen_t len = sizeof(struct linger);
struct WS_linger linger;
int len = sizeof(linger);
int ret;
if (!optlen || *optlen < sizeof(BOOL)|| !optval)
{
SetLastError(WSAEFAULT);
return SOCKET_ERROR;
}
if ( (fd = get_sock_fd( s, 0, NULL )) == -1)
return SOCKET_ERROR;
if (getsockopt(fd, SOL_SOCKET, SO_LINGER, &lingval, &len) != 0 )
if (!(ret = WS_getsockopt( s, WS_SOL_SOCKET, WS_SO_LINGER, (char *)&linger, &len )))
{
SetLastError(wsaErrno());
ret = SOCKET_ERROR;
}
else
{
*(BOOL *)optval = !lingval.l_onoff;
*(BOOL *)optval = !linger.l_onoff;
*optlen = sizeof(BOOL);
}
release_sock_fd( s, fd );
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment