summaryrefslogtreecommitdiff
path: root/libbb/print_file.c
diff options
context:
space:
mode:
authorGlenn L McGrath2002-12-13 08:20:44 +0000
committerGlenn L McGrath2002-12-13 08:20:44 +0000
commit25fe94fd32f39a76294456a7bc7b8dd0595afb0d (patch)
tree5f41636eb6f772de78a17e90189da6aeee3f32a7 /libbb/print_file.c
parenta67dffe186eefb6cf75c08422dbfa0e4a752c692 (diff)
downloadbusybox-25fe94fd32f39a76294456a7bc7b8dd0595afb0d.zip
busybox-25fe94fd32f39a76294456a7bc7b8dd0595afb0d.tar.gz
Merge copyfd and copy_file_chunk
Diffstat (limited to 'libbb/print_file.c')
-rw-r--r--libbb/print_file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libbb/print_file.c b/libbb/print_file.c
index a6df14e..cdd60e7 100644
--- a/libbb/print_file.c
+++ b/libbb/print_file.c
@@ -20,6 +20,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <sys/stat.h>
#include "libbb.h"
@@ -27,7 +28,9 @@
extern void print_file(FILE *file)
{
fflush(stdout);
- copyfd(fileno(file), fileno(stdout));
+ if (copyfd(fileno(file), fileno(stdout), 0) == -1) {
+ exit(EXIT_FAILURE);
+ }
fclose(file);
}