Socket: Set SO_NOSIGPIPE on macOS

This commit is contained in:
Sepalani 2020-10-01 13:25:34 +04:00
parent 31524288e3
commit 6675186520
1 changed files with 6 additions and 0 deletions

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