summaryrefslogtreecommitdiff
path: root/src/od.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/od.c
parentac8180336348bee878584b013d71f84e5d047f21 (diff)
downloadcoreutils-24f2bd8c9f62409ef7d7c919c9a53f438ee991cb.tar.xz
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/od.c')
-rw-r--r--src/od.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/od.c b/src/od.c
index d5b6cf8a1..1cfbbb8b2 100644
--- a/src/od.c
+++ b/src/od.c
@@ -1,5 +1,5 @@
/* od -- dump files in octal and other formats
- Copyright (C) 92, 1995-1999 Free Software Foundation, Inc.
+ Copyright (C) 92, 1995-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@
#include <getopt.h>
#include <sys/types.h>
#include "system.h"
+#include "closeout.h"
#include "error.h"
#include "xstrtol.h"
@@ -1584,6 +1585,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
err = 0;
for (i = 0; i <= MAX_INTEGRAL_TYPE_SIZE; i++)
@@ -1928,8 +1931,5 @@ cleanup:;
if (have_read_stdin && fclose (stdin) == EOF)
error (EXIT_FAILURE, errno, _("standard input"));
- if (fclose (stdout) == EOF)
- error (EXIT_FAILURE, errno, _("write error"));
-
exit (err == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}