diff options
author | Jim Meyering <jim@meyering.net> | 2000-05-24 07:10:12 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-05-24 07:10:12 +0000 |
commit | 449fa131d6380fb04333d28e663acb24a8fa8acc (patch) | |
tree | c39d3a55a26a0102a6c3855905875d04e25357de /src | |
parent | 0de83d1d81d83f8cc5334016bba32f8c26d5614d (diff) | |
download | coreutils-449fa131d6380fb04333d28e663acb24a8fa8acc.tar.xz |
(head_file): Use STDIN_FILENO in place of `0'.
(main): Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/head.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/head.c b/src/head.c index 44e0ab294..30dfd9905 100644 --- a/src/head.c +++ b/src/head.c @@ -192,8 +192,7 @@ head_file (const char *filename, uintmax_t n_units, int count_lines) filename = _("standard input"); if (print_headers) write_header (filename); - /* FIXME: use STDIN_FILENO, not `0' */ - return head (filename, 0, n_units, count_lines); + return head (filename, STDIN_FILENO, n_units, count_lines); } else { @@ -385,7 +384,7 @@ main (int argc, char **argv) for (; optind < argc; ++optind) exit_status |= head_file (argv[optind], n_units, count_lines); - if (have_read_stdin && close (0) < 0) + if (have_read_stdin && close (STDIN_FILENO) < 0) error (EXIT_FAILURE, errno, "-"); exit (exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE); |