Rob Landley writes:
Run this test, against both busybox and a non-busybox version of "tee". while true; do i=$[$i+1]; echo "hello $i"; sleep 1; done | ./busybox tee Now run the busybox one again with the following small patch applied:
This commit is contained in:
parent
7f164cd052
commit
d4d01d2b9b
@ -78,7 +78,7 @@ int tee_main(int argc, char **argv)
|
|||||||
*p = NULL; /* Store the sentinal value. */
|
*p = NULL; /* Store the sentinal value. */
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_TEE_USE_BLOCK_IO
|
#ifdef CONFIG_FEATURE_TEE_USE_BLOCK_IO
|
||||||
while ((c = fread(buf, 1, BUFSIZ, stdin)) != 0) {
|
while ((c = read(0, buf, BUFSIZ)) != 0) {
|
||||||
for (p=files ; *p ; p++) {
|
for (p=files ; *p ; p++) {
|
||||||
fwrite(buf, 1, c, *p);
|
fwrite(buf, 1, c, *p);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user