summaryrefslogtreecommitdiff
path: root/src/unexpand.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/unexpand.c
parentac8180336348bee878584b013d71f84e5d047f21 (diff)
downloadcoreutils-24f2bd8c9f62409ef7d7c919c9a53f438ee991cb.tar.xz
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/unexpand.c')
-rw-r--r--src/unexpand.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/unexpand.c b/src/unexpand.c
index 02420fff8..e1485b1ad 100644
--- a/src/unexpand.c
+++ b/src/unexpand.c
@@ -41,6 +41,7 @@
#include <getopt.h>
#include <sys/types.h>
#include "system.h"
+#include "closeout.h"
#include "error.h"
@@ -407,6 +408,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
have_read_stdin = 0;
exit_status = 0;
convert_entire_line = 0;
@@ -473,7 +476,5 @@ main (int argc, char **argv)
if (have_read_stdin && fclose (stdin) == EOF)
error (EXIT_FAILURE, errno, "-");
- if (fclose (stdout) == EOF)
- error (EXIT_FAILURE, errno, _("write error"));
exit (exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}