summaryrefslogtreecommitdiff
path: root/src/join.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/join.c
parentac8180336348bee878584b013d71f84e5d047f21 (diff)
downloadcoreutils-24f2bd8c9f62409ef7d7c919c9a53f438ee991cb.tar.xz
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/join.c')
-rw-r--r--src/join.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/join.c b/src/join.c
index 5fd02c60f..fb2064d4d 100644
--- a/src/join.c
+++ b/src/join.c
@@ -25,6 +25,7 @@
#include <getopt.h>
#include "system.h"
+#include "closeout.h"
#include "error.h"
#include "hard-locale.h"
#include "linebuffer.h"
@@ -737,6 +738,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
#ifdef ENABLE_NLS
hard_LC_COLLATE = hard_locale (LC_COLLATE);
#endif
@@ -868,8 +871,6 @@ main (int argc, char **argv)
error (EXIT_FAILURE, errno, "%s", names[1]);
if ((fp1 == stdin || fp2 == stdin) && fclose (stdin) == EOF)
error (EXIT_FAILURE, errno, "-");
- if (ferror (stdout) || fclose (stdout) == EOF)
- error (EXIT_FAILURE, errno, _("write error"));
exit (EXIT_SUCCESS);
}