summaryrefslogtreecommitdiff
path: root/src/tsort.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-05-20 22:06:38 +0000
committerJim Meyering <jim@meyering.net>2000-05-20 22:06:38 +0000
commit24f2bd8c9f62409ef7d7c919c9a53f438ee991cb (patch)
tree0d30aa82a2c6c12ab2224c5ecffb9ded6a11caaa /src/tsort.c
parentac8180336348bee878584b013d71f84e5d047f21 (diff)
downloadcoreutils-24f2bd8c9f62409ef7d7c919c9a53f438ee991cb.tar.xz
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/tsort.c')
-rw-r--r--src/tsort.c6
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"));