diff options
Diffstat (limited to 'src/tsort.c')
-rw-r--r-- | src/tsort.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tsort.c b/src/tsort.c index dca29189b..b03e012a5 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -30,6 +30,7 @@ #include <getopt.h> #include "system.h" +#include "closeout.h" #include "long-options.h" #include "error.h" #include "readtokens.h" @@ -552,6 +553,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + exit_status = 0; parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, @@ -579,9 +582,6 @@ main (int argc, char **argv) else tsort ("-"); - if (fclose (stdout) == EOF) - error (EXIT_FAILURE, errno, _("write error")); - if (have_read_stdin && fclose (stdin) == EOF) error (EXIT_FAILURE, errno, _("standard input")); |