Commit ddcf3d20cadf65dfe0f13c84cbcdd51775cbf858

Con Kolivas 2012-07-31T22:19:39

Differentiate between the send return value being a bool and the get return value when managing them in bitforce scanhash.

diff --git a/driver-bitforce.c b/driver-bitforce.c
index 123c5fc..4606e29 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -474,9 +474,10 @@ static int64_t bitforce_scanhash(struct thr_info *thr, struct work *work, int64_
 {
 	struct cgpu_info *bitforce = thr->cgpu;
 	unsigned int sleep_time;
+	bool send_ret;
 	int64_t ret;
 
-	ret = bitforce_send_work(thr, work);
+	send_ret = bitforce_send_work(thr, work);
 
 	if (!bitforce->nonce_range) {
 		/* Initially wait 2/3 of the average cycle time so we can request more
@@ -502,8 +503,10 @@ static int64_t bitforce_scanhash(struct thr_info *thr, struct work *work, int64_
 		bitforce->wait_ms = sleep_time;
 	}
 
-	if (ret)
+	if (send_ret)
 		ret = bitforce_get_result(thr, work);
+	else
+		ret = -1;
 
 	if (ret == -1) {
 		ret = 0;