Re: [Bench] New benchmark showing fileserver problem in 2.4.12

Leo Mauro (lmauro@usb.ve)
Wed, 17 Oct 2001 22:01:09 -0400


Small fix to Linus's sample code

unsigned int so_far = 0;
for (;;) {
int bytes = read(in, buf+so_far, BUFSIZE-so_far);
if (bytes <= 0)
break;
so_far += bytes;
if (so_far < BUFSIZE)
continue;
write(out, buf, BUFSIZE);
- so_far = 0;
+ so_far -= BUFSIZE;
}
if (so_far)
write(out, buf, so_far);

to avoid losing data.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/