From 2936a30e0ae70b8d1a984914f93113716a8bc620 Mon Sep 17 00:00:00 2001 From: Heikki Lindholm Date: Sat, 17 Oct 2009 20:58:41 +0000 Subject: [PATCH] OS X version of MSG_NOSIGNAL --- src/util/network.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 2.25.1