diff options
author | Eric Andersen | 2001-05-15 17:48:09 +0000 |
---|---|---|
committer | Eric Andersen | 2001-05-15 17:48:09 +0000 |
commit | 55f9872616f0c42f3fb712cfb7f9d0bb52c8afcb (patch) | |
tree | 4dc106a5142e993d2a5e9bad32f2fcd53555047c /libbb/print_file.c | |
parent | c911a4389bbaa5ac85d725c8c05e452dfba8583d (diff) | |
download | busybox-55f9872616f0c42f3fb712cfb7f9d0bb52c8afcb.zip busybox-55f9872616f0c42f3fb712cfb7f9d0bb52c8afcb.tar.gz |
This patch from Adam Heath <doogie@debian.org>, makes print_file
(used by cat, grep, sed, etc) quite a bit faster.
Diffstat (limited to 'libbb/print_file.c')
-rw-r--r-- | libbb/print_file.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libbb/print_file.c b/libbb/print_file.c index b477234..bfedc5e 100644 --- a/libbb/print_file.c +++ b/libbb/print_file.c @@ -26,12 +26,9 @@ extern void print_file(FILE *file) { - int c; - - while ((c = getc(file)) != EOF) - putc(c, stdout); - fclose(file); fflush(stdout); + copyfd(fileno(file), fileno(stdout)); + fclose(file); } extern int print_file_by_name(char *filename) |