Skip to content

Commit

Permalink
Darwin needs to use SO_NOSIGPIPE.
Browse files Browse the repository at this point in the history
gdamore committed Nov 5, 2017
1 parent 1bc7867 commit cf6527e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/posix/posix_pipedesc.c
Original file line number Diff line number Diff line change
@@ -333,10 +333,10 @@ nni_posix_pipedesc_init(nni_posix_pipedesc **pdp, int fd)

(void) fcntl(fd, F_SETFL, O_NONBLOCK);

#ifdef SO_NOSIGNAL
#ifdef SO_NOSIGPIPE
// Darwin lacks MSG_NOSIGNAL, but has a socket option.
int one = 1;
(void) setsockopt(fd, SOL_SOCKET, SO_NOSIGNAL, &one, sizeof(one));
(void) setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(one));
#endif

nni_mtx_init(&pd->mtx);

0 comments on commit cf6527e

Please sign in to comment.