Browse Source

Merge commit 'cada0d3' into cg_merges_20121214

Conflicts:
	util.c
Luke Dashjr 13 years ago
parent
commit
7f59550b5c
2 changed files with 6 additions and 2 deletions
  1. 4 0
      miner.h
  2. 2 2
      util.c

+ 4 - 0
miner.h

@@ -60,6 +60,10 @@ static inline int fsync (int fd)
 	return (FlushFileBuffers ((HANDLE) _get_osfhandle (fd))) ? 0 : -1;
 }
 
+#ifndef EWOULDBLOCK
+# define EWOULDBLOCK EAGAIN
+#endif
+
 #ifndef MSG_DONTWAIT
 # define MSG_DONTWAIT 0x1000000
 #endif

+ 2 - 2
util.c

@@ -950,7 +950,7 @@ static bool __stratum_send(struct pool *pool, char *s, ssize_t len)
 		}
 		sent = send(pool->sock, s + ssent, len, 0);
 		if (sent < 0) {
-			if (errno != EAGAIN) {
+			if (errno != EAGAIN && errno != EWOULDBLOCK) {
 				applog(LOG_DEBUG, "Failed to curl_easy_send in stratum_send");
 				return false;
 			}
@@ -1035,7 +1035,7 @@ char *recv_line(struct pool *pool)
 		n = recv(pool->sock, s, RECVSIZE, 0);
 		mutex_unlock(&pool->stratum_lock);
 
-		if (n < 1 && errno != EAGAIN) {
+		if (n < 1 && errno != EAGAIN && errno != EWOULDBLOCK) {
 			applog(LOG_DEBUG, "Failed to recv sock in recv_line: %d", errno);
 			goto out;
 		}