summaryrefslogtreecommitdiff
path: root/src/md5sum.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/md5sum.c
parentac8180336348bee878584b013d71f84e5d047f21 (diff)
downloadcoreutils-24f2bd8c9f62409ef7d7c919c9a53f438ee991cb.tar.xz
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/md5sum.c')
-rw-r--r--src/md5sum.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/md5sum.c b/src/md5sum.c
index afdb2406e..da994f18d 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -1,6 +1,6 @@
/* Compute MD5 checksum of files or strings according to the definition
of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995-1999 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -29,6 +29,7 @@
#include "md5.h"
#include "getline.h"
#include "system.h"
+#include "closeout.h"
#include "error.h"
/* The official name of this program (e.g., no `g' prefix). */
@@ -472,6 +473,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
while ((opt = getopt_long (argc, argv, "bctw", long_options, NULL)) != -1)
switch (opt)
{
@@ -625,9 +628,6 @@ verifying checksums"));
}
}
- if (fclose (stdout) == EOF)
- error (EXIT_FAILURE, errno, _("write error"));
-
if (have_read_stdin && fclose (stdin) == EOF)
error (EXIT_FAILURE, errno, _("standard input"));