Zebediah Figura : ws2_32: Implement getsockopt(SO_DONTLINGER) on top of Win32 getsockopt(SO_LINGER).
Alexandre Julliard
julliard at winehq.org
Fri Jun 25 16:29:07 CDT 2021
Module: wine
Branch: master
Commit: 1d7d57326af8c339bfd82f27c2d344d05be660b6
URL: https://source.winehq.org/git/wine.git/?a=commit;h=1d7d57326af8c339bfd82f27c2d344d05be660b6
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Thu Jun 24 22:32:47 2021 -0500
ws2_32: Implement getsockopt(SO_DONTLINGER) on top of Win32 getsockopt(SO_LINGER).
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ws2_32/socket.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 3925a7ed500..112376e583c 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -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;
}
More information about the wine-cvs
mailing list