Commit 3db4d6f0eb9b71d0e2744424c4bf522b89ecb22e

Con Kolivas 2013-03-07T21:07:15

Display select return value on select fail in stratum thread.

diff --git a/cgminer.c b/cgminer.c
index abc7755..b94d750 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4853,6 +4853,7 @@ static void *stratum_thread(void *userdata)
 
 	while (42) {
 		struct timeval timeout;
+		int sel_ret;
 		fd_set rd;
 		char *s;
 
@@ -4887,8 +4888,8 @@ static void *stratum_thread(void *userdata)
 		 * every minute so if we fail to receive any for 90 seconds we
 		 * assume the connection has been dropped and treat this pool
 		 * 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;
 		} else
 			s = recv_line(pool);