summaryrefslogtreecommitdiff
path: root/src/tr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tr.c')
-rw-r--r--src/tr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tr.c b/src/tr.c
index 21a82ca84..7bf050ba9 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -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"));