Browse Source

Merge branch 'bf_err_reopen' into bfgminer

Luke Dashjr 13 years ago
parent
commit
7123bdc5cf
1 changed files with 6 additions and 0 deletions
  1. 6 0
      driver-bitforce.c

+ 6 - 0
driver-bitforce.c

@@ -644,6 +644,12 @@ commerr:
 		bitforce->device_not_well_reason = REASON_DEV_COMMS_ERROR;
 		bitforce->dev_comms_error_count++;
 		bitforce->hw_errors++;
+		BFclose(bitforce->device_fd);
+		int fd = bitforce->device_fd = BFopen(bitforce->device_path);
+		if (fd == -1) {
+			applog(LOG_ERR, "BFL%i: Error reopening");
+			return -1;
+		}
 		/* empty read buffer */
 		bitforce_clear_buffer(bitforce);
 	}