Browse Source

Bugfix: bitforce: Short-circuit bitforce_read(0) to avoid lowlif issues

Luke Dashjr 11 years ago
parent
commit
22143a5e2c
1 changed files with 6 additions and 1 deletions
  1. 6 1
      driver-bitforce.c

+ 6 - 1
driver-bitforce.c

@@ -360,7 +360,12 @@ ssize_t bitforce_read(struct cgpu_info * const proc, void * const buf, const siz
 	ssize_t rv;
 	
 	if (likely(devdata->is_open))
-		rv = devdata->lowlif->read(buf, bufLen, dev);
+	{
+		if (bufLen == 0)
+			rv = 0;
+		else
+			rv = devdata->lowlif->read(buf, bufLen, dev);
+	}
 	else
 		rv = -1;