diff options
Diffstat (limited to 'coreutils/cat.c')
-rw-r--r-- | coreutils/cat.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/coreutils/cat.c b/coreutils/cat.c index 7bab325..eb141dc 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -12,17 +12,23 @@ #include "busybox.h" +/* This is a NOFORK applet. Be very careful! */ + + int bb_cat(char **argv) { static const char *const argv_dash[] = { "-", NULL }; + FILE *f; int retval = EXIT_SUCCESS; - if (!*argv) argv = (char**) &argv_dash; + if (!*argv) + argv = (char**) &argv_dash; do { f = fopen_or_warn_stdin(*argv); if (f) { + /* This is not an xfunc - never exits */ off_t r = bb_copyfd_eof(fileno(f), STDOUT_FILENO); fclose_if_not_stdin(f); if (r >= 0) |