From: Jim Meyering Date: Sun, 7 May 2000 14:57:52 +0000 (+0000) Subject: Include "closeout.h". X-Git-Tag: SH-UTILS-2_0h~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c6b0fefde1f58793f2ac9e164c94197fcac230cf;p=thirdparty%2Fcoreutils.git Include "closeout.h". (main): Call atexit with close_stdout. --- diff --git a/src/pwd.c b/src/pwd.c index 13812220e5..3642c9bd3d 100644 --- a/src/pwd.c +++ b/src/pwd.c @@ -66,6 +66,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, AUTHORS, usage); @@ -77,7 +79,5 @@ main (int argc, char **argv) error (1, errno, _("cannot get current directory")); printf ("%s\n", wd); - close_stdout (); - exit (0); } diff --git a/src/seq.c b/src/seq.c index def96ae818..eb48d870a1 100644 --- a/src/seq.c +++ b/src/seq.c @@ -339,6 +339,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + equal_width = 0; separator = "\n"; first = 1.0; @@ -455,7 +457,5 @@ format string may not be specified when printing equal width strings")); errs = print_numbers (format_str); - close_stdout (); - exit (errs); }