diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-12-13 08:20:44 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-12-13 08:20:44 +0000 |
commit | 25fe94fd32f39a76294456a7bc7b8dd0595afb0d (patch) | |
tree | 5f41636eb6f772de78a17e90189da6aeee3f32a7 /libbb/print_file.c | |
parent | a67dffe186eefb6cf75c08422dbfa0e4a752c692 (diff) | |
download | busybox-w32-25fe94fd32f39a76294456a7bc7b8dd0595afb0d.tar.gz busybox-w32-25fe94fd32f39a76294456a7bc7b8dd0595afb0d.tar.bz2 busybox-w32-25fe94fd32f39a76294456a7bc7b8dd0595afb0d.zip |
Merge copyfd and copy_file_chunk
Diffstat (limited to 'libbb/print_file.c')
-rw-r--r-- | libbb/print_file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libbb/print_file.c b/libbb/print_file.c index a6df14ed9..cdd60e7a0 100644 --- a/libbb/print_file.c +++ b/libbb/print_file.c | |||
@@ -20,6 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | #include <stdlib.h> | ||
23 | #include <sys/stat.h> | 24 | #include <sys/stat.h> |
24 | #include "libbb.h" | 25 | #include "libbb.h" |
25 | 26 | ||
@@ -27,7 +28,9 @@ | |||
27 | extern void print_file(FILE *file) | 28 | extern void print_file(FILE *file) |
28 | { | 29 | { |
29 | fflush(stdout); | 30 | fflush(stdout); |
30 | copyfd(fileno(file), fileno(stdout)); | 31 | if (copyfd(fileno(file), fileno(stdout), 0) == -1) { |
32 | exit(EXIT_FAILURE); | ||
33 | } | ||
31 | fclose(file); | 34 | fclose(file); |
32 | } | 35 | } |
33 | 36 | ||