Browse Source

Bugfix: icarus: Set firstrun for errors starting next job, so the current one finishes properly

Luke Dashjr 13 years ago
parent
commit
a08cd4bae2
1 changed files with 5 additions and 4 deletions
  1. 5 4
      driver-icarus.c

+ 5 - 4
driver-icarus.c

@@ -860,10 +860,11 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 	}
 	}
 
 
 	if (!icarus_start_work(thr, ob_bin))
 	if (!icarus_start_work(thr, ob_bin))
-		return -1;	/* This should never happen */
+		/* This should never happen */
+		state->firstrun = true;
 
 
 	if (info->quirk_reopen == 2 && !icarus_reopen(icarus, state, &fd))
 	if (info->quirk_reopen == 2 && !icarus_reopen(icarus, state, &fd))
-		return -1;
+		state->firstrun = true;
 
 
 	work->blk.nonce = 0xffffffff;
 	work->blk.nonce = 0xffffffff;
 
 
@@ -907,10 +908,10 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 	if (was_hw_error)
 	if (was_hw_error)
 		if (info->quirk_reopen != 2) {
 		if (info->quirk_reopen != 2) {
 			if (!icarus_reopen(icarus, state, &fd))
 			if (!icarus_reopen(icarus, state, &fd))
-				return -1;
+				state->firstrun = true;
 			// Some devices (Cairnsmore1, for example) abort hashing when reopened, so send the job again
 			// Some devices (Cairnsmore1, for example) abort hashing when reopened, so send the job again
 			if (!icarus_start_work(thr, ob_bin))
 			if (!icarus_start_work(thr, ob_bin))
-				return -1;	/* This should never happen */
+				state->firstrun = true;
 		}
 		}
 
 
 	hash_count = (nonce & info->nonce_mask);
 	hash_count = (nonce & info->nonce_mask);