From a35205d3f29ba5688d85420c2fa5d14dae4b0fd8 Mon Sep 17 00:00:00 2001 From: nelisky Date: Wed, 14 Mar 2012 21:31:13 +0000 Subject: [PATCH] Some tweasks towards clean exit on error --- mkinstalldirs | 0 ztex.c | 10 +++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 mkinstalldirs diff --git a/mkinstalldirs b/mkinstalldirs old mode 100644 new mode 100755 diff --git a/ztex.c b/ztex.c index 02b60751..be3366ed 100644 --- a/ztex.c +++ b/ztex.c @@ -164,7 +164,11 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work, if (work_restart[thr->id].restart) { break; } - libztex_readHashData(ztex, &hdata[0]); + i = libztex_readHashData(ztex, &hdata[0]); + if (i < 0) { + // Something wrong happened in read + + } if (work_restart[thr->id].restart) { break; } @@ -220,13 +224,13 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work, if (!ztex_updateFreq(ztex)) { // Something really serious happened, so mark this thread as dead! - thr->cgpu->status = LIFE_DEAD; + return 0; } applog(LOG_DEBUG, "exit %1.8X", noncecnt); work->blk.nonce = 0xffffffff; - return noncecnt; + return noncecnt > 0 ? noncecnt : 1; } static bool ztex_prepare(struct thr_info *thr)