Browse Source

Bugfix: bitforce: XLINK: Avoid trying to send 0 bytes after each write

Luke Dashjr 12 years ago
parent
commit
ef4c0504a0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      driver-bitforce.c

+ 2 - 1
driver-bitforce.c

@@ -76,13 +76,14 @@ static ssize_t bitforce_send(int fd, int procid, const void *buf, ssize_t bufLen
 	realbuf[1] = procid;
 	realbuf[1] = procid;
 	realbuf[2] = bufLen;
 	realbuf[2] = bufLen;
 	bufp = realbuf;
 	bufp = realbuf;
-	while (true)
+	do
 	{
 	{
 		rv = BFwrite(fd, bufp, bufLeft);
 		rv = BFwrite(fd, bufp, bufLeft);
 		if (rv <= 0)
 		if (rv <= 0)
 			return rv;
 			return rv;
 		bufLeft -= rv;
 		bufLeft -= rv;
 	}
 	}
+	while (bufLeft > 0);
 	return bufLen;
 	return bufLen;
 }
 }