From 70e5178bdeaee9c81cbe752a25408c0b867757b8 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 11 May 2000 07:21:33 +0000 Subject: (usage): Don't call close_stdout directly, since that didn't cover --version output. (main): Arrange to call close_stdout via atexit, instead. --- src/yes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/yes.c') diff --git a/src/yes.c b/src/yes.c index 33ca609c0..59aa17b8e 100644 --- a/src/yes.c +++ b/src/yes.c @@ -54,7 +54,6 @@ Repeatedly output a line with all specified STRING(s), or `y'.\n\ --version output version information and exit\n")); puts (_("\nReport bugs to .")); } - close_stdout (); exit (status); } @@ -66,6 +65,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ if (getenv ("POSIXLY_CORRECT") == NULL) parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, -- cgit v1.2.3-54-g00ecf