Skip to content
Permalink
Browse files
Merge pull request #9123 from sepalani/bsd-socket-crash
Socket: Set SO_NOSIGPIPE on macOS
  • Loading branch information
stenzek committed Oct 2, 2020
2 parents 3152428 + 6675186 commit 56e8058
Showing 1 changed file with 6 additions and 0 deletions.
@@ -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);

0 comments on commit 56e8058

Please sign in to comment.