Browse Source

Merge commit '3db4d6f' into cg_merges_20130513

Luke Dashjr 13 years ago
parent
commit
3b6a7d9cdb
1 changed files with 3 additions and 2 deletions
  1. 3 2
      miner.c

+ 3 - 2
miner.c

@@ -6168,6 +6168,7 @@ static void *stratum_thread(void *userdata)
 
 
 	while (42) {
 	while (42) {
 		struct timeval timeout;
 		struct timeval timeout;
+		int sel_ret;
 		fd_set rd;
 		fd_set rd;
 		char *s;
 		char *s;
 
 
@@ -6201,8 +6202,8 @@ static void *stratum_thread(void *userdata)
 		/* If we fail to receive any notify messages for 2 minutes we
 		/* If we fail to receive any notify messages for 2 minutes we
 		 * assume the connection has been dropped and treat this pool
 		 * assume the connection has been dropped and treat this pool
 		 * as dead */
 		 * as dead */
-		if (!sock_full(pool) && select(pool->sock + 1, &rd, NULL, NULL, &timeout) < 1) {
-			applog(LOG_DEBUG, "Stratum select timeout on pool %d", pool->pool_no);
+		if (!sock_full(pool) && (sel_ret = select(pool->sock + 1, &rd, NULL, NULL, &timeout)) < 1) {
+			applog(LOG_DEBUG, "Stratum select failed on pool %d with value %d", pool->pool_no, sel_ret);
 			s = NULL;
 			s = NULL;
 		} else
 		} else
 			s = recv_line(pool);
 			s = recv_line(pool);