darwin, freebsd: set SO_NOSIGPIPE on sockets
Suppresses delivery of SIGPIPE signals when the remote end of the socket has gone away.
This commit is contained in:
parent
dcd3b55c19
commit
90271e1a3c
@ -325,6 +325,13 @@ int uv__socket(int domain, int type, int protocol) {
|
||||
sockfd = -1;
|
||||
}
|
||||
|
||||
#if defined(SO_NOSIGPIPE)
|
||||
{
|
||||
int on = 1;
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on));
|
||||
}
|
||||
#endif
|
||||
|
||||
out:
|
||||
return sockfd;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user