diff options
author | Jim Meyering <jim@meyering.net> | 2000-05-20 22:06:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-05-20 22:06:38 +0000 |
commit | 24f2bd8c9f62409ef7d7c919c9a53f438ee991cb (patch) | |
tree | 0d30aa82a2c6c12ab2224c5ecffb9ded6a11caaa /src/pr.c | |
parent | ac8180336348bee878584b013d71f84e5d047f21 (diff) | |
download | coreutils-24f2bd8c9f62409ef7d7c919c9a53f438ee991cb.tar.xz |
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/pr.c')
-rw-r--r-- | src/pr.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -318,6 +318,7 @@ #include <sys/types.h> #include <time.h> #include "system.h" +#include "closeout.h" #include "error.h" #include "xstrtol.h" @@ -853,6 +854,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + n_files = 0; file_names = (argc > 1 ? (char **) xmalloc ((argc - 1) * sizeof (char *)) @@ -1162,8 +1165,6 @@ main (int argc, char **argv) if (have_read_stdin && fclose (stdin) == EOF) error (EXIT_FAILURE, errno, _("standard input")); - if (ferror (stdout) || fclose (stdout) == EOF) - error (EXIT_FAILURE, errno, _("write error")); if (failed_opens > 0) exit (EXIT_FAILURE); exit (EXIT_SUCCESS); |