[PATCH] ws2_32: Ignore a SO_SNDBUF value of 0 on OSX

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Sun Nov 18 21:00:24 CST 2018


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/ws2_32/socket.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index df068fe..ea87a7a 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -5770,6 +5770,15 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
         return SOCKET_ERROR;
     }
 
+#ifdef __APPLE__
+    if(level == WS_SOL_SOCKET && optname == WS_SO_SNDBUF &&
+        optval && *(const int*)optval == 0)
+    {
+        WARN("Setting SO_SNDBUF to 0: ignored\n");
+        return 0;
+    }
+#endif
+
     switch(level)
     {
     case WS_SOL_SOCKET:
-- 
1.9.1




More information about the wine-devel mailing list