Browse Source

Bugfix: gridseed: Report communication errors using dev_error()

Nate Woolls 11 years ago
parent
commit
ca3d7a1493
1 changed files with 7 additions and 0 deletions
  1. 7 0
      driver-gridseed.c

+ 7 - 0
driver-gridseed.c

@@ -178,6 +178,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;
 	}
 
@@ -248,6 +249,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;