ws2_32: Set SO_REUSEPORT in addition to SO_REUSEADDR on MacOS.

This commit is contained in:
Hans Leidekker 2013-01-11 17:22:59 +01:00 committed by Alexandre Julliard
parent 24b66842c4
commit 197041f1ff

View File

@ -4452,6 +4452,15 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
if (setsockopt(fd, level, optname, optval, optlen) == 0)
{
#ifdef __APPLE__
if (level == SOL_SOCKET && optname == SO_REUSEADDR &&
setsockopt(fd, level, SO_REUSEPORT, optval, optlen) != 0)
{
SetLastError(wsaErrno());
release_sock_fd( s, fd );
return SOCKET_ERROR;
}
#endif
release_sock_fd( s, fd );
return 0;
}