diff options
author | Jim Meyering <jim@meyering.net> | 2000-05-20 22:06:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-05-20 22:06:38 +0000 |
commit | 24f2bd8c9f62409ef7d7c919c9a53f438ee991cb (patch) | |
tree | 0d30aa82a2c6c12ab2224c5ecffb9ded6a11caaa /src/wc.c | |
parent | ac8180336348bee878584b013d71f84e5d047f21 (diff) | |
download | coreutils-24f2bd8c9f62409ef7d7c919c9a53f438ee991cb.tar.xz |
Arrange to call close_stdout upon exit. Don't close stdout explicitly.
Diffstat (limited to 'src/wc.c')
-rw-r--r-- | src/wc.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,5 @@ /* wc - print the number of bytes, words, and lines in files - Copyright (C) 85, 91, 1995-1999 Free Software Foundation, Inc. + Copyright (C) 85, 91, 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 @@ -27,6 +27,7 @@ #include <getopt.h> #include <sys/types.h> #include "system.h" +#include "closeout.h" #include "error.h" #include "human.h" #include "safe-read.h" @@ -309,6 +310,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + exit_status = 0; posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); print_lines = print_words = print_chars = print_linelength = 0; |