Merge pull request #9123 from sepalani/bsd-socket-crash

Socket: Set SO_NOSIGPIPE on macOS
This commit is contained in:
Connor McLaughlin 2020-10-02 20:17:37 +10:00 committed by GitHub
commit 56e8058a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);