diff --git a/src/unix/core.c b/src/unix/core.c index 06d689ca..94074525 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -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; }