From 24f2bd8c9f62409ef7d7c919c9a53f438ee991cb Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 20 May 2000 22:06:38 +0000 Subject: Arrange to call close_stdout upon exit. Don't close stdout explicitly. --- src/tsort.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tsort.c') 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 #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")); -- cgit v1.2.3-54-g00ecf