diff options
Diffstat (limited to 'src/tr.c')
-rw-r--r-- | src/tr.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -26,6 +26,7 @@ #include <getopt.h> #include "system.h" +#include "closeout.h" #include "error.h" #include "safe-read.h" #include "xstrtol.h" @@ -1783,6 +1784,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + while ((c = getopt_long (argc, argv, "cdst", long_options, NULL)) != -1) { switch (c) @@ -2006,9 +2009,6 @@ construct in string1 must be aligned with a corresponding construct\n\ } } - if (fclose (stdout) == EOF) - error (EXIT_FAILURE, errno, _("write error")); - if (close (0) != 0) error (EXIT_FAILURE, errno, _("standard input")); |