- if ((f = bb_wfopen_input(*argv)) != NULL) {
- int r = bb_copyfd_eof(fileno(f), STDOUT_FILENO);
- bb_fclose_nonstdin(f);
- if (r >= 0) {
+ fd = open_or_warn_stdin(*argv);
+ if (fd >= 0) {
+ /* This is not a xfunc - never exits */
+ off_t r = bb_copyfd_eof(fd, STDOUT_FILENO);
+ if (fd != STDIN_FILENO)
+ close(fd);
+ if (r >= 0)