summaryrefslogtreecommitdiff
path: root/src/csplit.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-05-20 22:04:40 +0000
committerJim Meyering <jim@meyering.net>2000-05-20 22:04:40 +0000
commitac8180336348bee878584b013d71f84e5d047f21 (patch)
tree72f81b1e9047cfbc782139a943514ded264f386b /src/csplit.c
parentb2c7c6055d627e8c8bd1ede48b7c99272a850c54 (diff)
downloadcoreutils-ac8180336348bee878584b013d71f84e5d047f21.tar.xz
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/csplit.c')
-rw-r--r--src/csplit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/csplit.c b/src/csplit.c
index 3be33fa92..a4fe0e75e 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -27,6 +27,7 @@
#include <signal.h>
#include "system.h"
+#include "closeout.h"
#include <regex.h>
@@ -1383,6 +1384,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
global_argv = argv;
controls = NULL;
control_used = 0;
@@ -1489,9 +1492,6 @@ main (int argc, char **argv)
cleanup_fatal ();
}
- if (!suppress_count && (ferror (stdout) || fclose (stdout) == EOF))
- error (EXIT_FAILURE, errno, _("write error"));
-
exit (EXIT_SUCCESS);
}