readChunk:
last commit may have fixed a bug in the handling of incomplete reads,
but at the cost of breaking the (common) case of complete
reads :-/. Should work better in both cases now.
while ((count = read(fd, p, len)) < len) {
if ( count == 0 ) { /* EOF */
- return total_count;
+ break;
} else if ( count == -1 && errno == EAGAIN) {
errno = 0;
return FILEOBJ_BLOCKED_READ;
p += count;
}
+ total_count += count;
fo->bufWPtr = total_count;
fo->bufRPtr = 0;
return total_count;