Browse Source

Update util.c

Apple OS/X does not define MSG_NOSIGNAL.  Use SO_NOSIGPIPE instead
nfactor-troky
mhren 12 years ago
parent
commit
c5bfc45233
  1. 8
      util.c

8
util.c

@ -966,10 +966,12 @@ static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len)
FD_SET(sock, &wd); FD_SET(sock, &wd);
if (select(sock + 1, NULL, &wd, NULL, &timeout) < 1) if (select(sock + 1, NULL, &wd, NULL, &timeout) < 1)
return SEND_SELECTFAIL; return SEND_SELECTFAIL;
#ifndef WIN32 #ifdef __APPLE__
sent = send(pool->sock, s + ssent, len, MSG_NOSIGNAL); sent = send(pool->sock, s + ssent, len, SO_NOSIGPIPE);
#else #elif WIN32
sent = send(pool->sock, s + ssent, len, 0); sent = send(pool->sock, s + ssent, len, 0);
#else
sent = send(pool->sock, s + ssent, len, MSG_NOSIGNAL);
#endif #endif
if (sent < 0) { if (sent < 0) {
if (!sock_blocks()) if (!sock_blocks())

Loading…
Cancel
Save