From 66751865208754dba3d5d31a3680ac7296c05e68 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Thu, 1 Oct 2020 13:25:34 +0400 Subject: [PATCH] Socket: Set SO_NOSIGPIPE on macOS --- Source/Core/Core/IOS/Network/Socket.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/IOS/Network/Socket.cpp b/Source/Core/Core/IOS/Network/Socket.cpp index ae8f2b08e3..410db2db5a 100644 --- a/Source/Core/Core/IOS/Network/Socket.cpp +++ b/Source/Core/Core/IOS/Network/Socket.cpp @@ -648,6 +648,12 @@ s32 WiiSockMan::AddSocket(s32 fd, bool is_rw) WiiSocket& sock = WiiSockets[wii_fd]; sock.SetFd(fd); sock.SetWiiFd(wii_fd); + +#ifdef __APPLE__ + int opt_no_sigpipe = 1; + if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &opt_no_sigpipe, sizeof(opt_no_sigpipe)) < 0) + ERROR_LOG(IOS_NET, "Failed to set SO_NOSIGPIPE on socket"); +#endif } SetLastNetError(wii_fd);