Skip to content

Commit

Permalink
Merge pull request #522 from nwoolls/bug/gridseed-report-comm-errors
Browse files Browse the repository at this point in the history
Bugfix: gridseed: Report communication errors using dev_error()
  • Loading branch information
luke-jr committed Jul 21, 2014
2 parents ff6d8b2 + ca3d7a1 commit 5f0e163
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions driver-gridseed.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ bool gridseed_prepare_work(struct thr_info __maybe_unused *thr, struct work *wor
if (sizeof(cmd) != gc3355_write(device->device_fd, cmd, sizeof(cmd)))
{
applog(LOG_ERR, "%s: Failed to send work", device->dev_repr);
dev_error(device, REASON_DEV_COMMS_ERROR);
return false;
}

Expand Down Expand Up @@ -252,6 +253,12 @@ int64_t gridseed_scanhash(struct thr_info *thr, struct work *work, int64_t __may
}
}

if (read == -1)
{
applog(LOG_ERR, "%s: Failed to read result", device->dev_repr);
dev_error(device, REASON_DEV_COMMS_ERROR);
}

gridseed_hashes_done(thr);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion gc3355.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ int gc3355_read(int fd, char *buf, size_t size)
}

if (unlikely(tries == 0))
return -1;
return read;

if ((read > 0) && opt_dev_protocol)
gc3355_log_protocol(fd, buf, read, "RECV");
Expand Down

0 comments on commit 5f0e163

Please sign in to comment.