tcp: (Mac OS X) added setsockopt(SOL_SOCKET, SO_NOSIGPIPE) to prevent the application crashing on a broken socket.

This commit is contained in:
Benoît LeBlanc 2014-04-10 16:26:44 -04:00
parent 7e658b9dc4
commit 3581d27f08
1 changed files with 8 additions and 0 deletions

View File

@ -276,6 +276,14 @@ BOOL tcp_set_keep_alive_mode(rdpTcp* tcp)
#endif
#endif
#ifdef __MACOSX__
option_value = 1;
option_len = sizeof(option_value);
if (setsockopt(tcp->sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *) &option_value, option_len) < 0)
{
perror("setsockopt() SOL_SOCKET, SO_NOSIGPIPE:");
}
#endif
return TRUE;
}