Commit c4a8f4776926b8b092f150edc801ad5c3bc26971

Con Kolivas 2013-05-11T21:37:36

Merge pull request #429 from mhren/patch-1 Update util.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/util.c b/util.c
index ba98c8a..3e26521 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())