From: Heikki Lindholm Date: Sat, 17 Oct 2009 20:58:41 +0000 (+0000) Subject: OS X version of MSG_NOSIGNAL X-Git-Tag: initial-import-from-subversion-38251~23354 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2936a30e0ae70b8d1a984914f93113716a8bc620;p=oweals%2Fgnunet.git OS X version of MSG_NOSIGNAL --- diff --git a/src/util/network.c b/src/util/network.c index 9a38dc098..5ba849138 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -333,6 +333,13 @@ GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle * desc, { int ret; int flags; +#ifdef OSX + int no_sigpipe; + no_sigpipe = 1; + /* shouldn't matter if this fails as there's a SIGPIPE handler */ + ret = setsockopt (desc->fd, SOL_SOCKET, SO_NOSIGPIPE, + (void *) &no_sigpipe, sizeof (no_sigpipe)); +#endif flags = 0; #ifdef MSG_DONTWAIT @@ -370,6 +377,13 @@ GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle * desc, { int ret; int flags; +#ifdef OSX + int no_sigpipe; + no_sigpipe = 1; + /* shouldn't matter if this fails as there's a SIGPIPE handler */ + ret = setsockopt (desc->fd, SOL_SOCKET, SO_NOSIGPIPE, + (void *) &no_sigpipe, sizeof (no_sigpipe)); +#endif flags = 0; #ifdef MSG_DONTWAIT