{\r
int ret;\r
int flags;\r
+#ifdef OSX\r
+ int no_sigpipe;\r
+ no_sigpipe = 1;\r
+ /* shouldn't matter if this fails as there's a SIGPIPE handler */\r
+ ret = setsockopt (desc->fd, SOL_SOCKET, SO_NOSIGPIPE,\r
+ (void *) &no_sigpipe, sizeof (no_sigpipe));\r
+#endif\r
\r
flags = 0;\r
#ifdef MSG_DONTWAIT\r
{\r
int ret;\r
int flags;\r
+#ifdef OSX\r
+ int no_sigpipe;\r
+ no_sigpipe = 1;\r
+ /* shouldn't matter if this fails as there's a SIGPIPE handler */\r
+ ret = setsockopt (desc->fd, SOL_SOCKET, SO_NOSIGPIPE,\r
+ (void *) &no_sigpipe, sizeof (no_sigpipe));\r
+#endif\r
\r
flags = 0;\r
#ifdef MSG_DONTWAIT\r