From c5bfc4523375777e9ad0896204d54fd9ba3634f2 Mon Sep 17 00:00:00 2001 From: mhren Date: Sat, 11 May 2013 23:32:57 -0500 Subject: [PATCH] Update util.c Apple OS/X does not define MSG_NOSIGNAL. Use SO_NOSIGPIPE instead --- util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util.c b/util.c index ba98c8a9..3e265210 100644 --- a/util.c +++ b/util.c @@ -966,10 +966,12 @@ static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len) FD_SET(sock, &wd); if (select(sock + 1, NULL, &wd, NULL, &timeout) < 1) return SEND_SELECTFAIL; -#ifndef WIN32 - sent = send(pool->sock, s + ssent, len, MSG_NOSIGNAL); -#else +#ifdef __APPLE__ + sent = send(pool->sock, s + ssent, len, SO_NOSIGPIPE); +#elif WIN32 sent = send(pool->sock, s + ssent, len, 0); +#else + sent = send(pool->sock, s + ssent, len, MSG_NOSIGNAL); #endif if (sent < 0) { if (!sock_blocks())