From: Jim Meyering Date: Thu, 11 May 2000 07:23:42 +0000 (+0000) Subject: (usage): Don't call close_stdout_status directly, X-Git-Tag: FILEUTILS-4_0s~73 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a3d9df9a1dba883bb662591e4a638158f6db678;p=platform%2Fupstream%2Fcoreutils.git (usage): Don't call close_stdout_status directly, since that didn't cover --version output. (main): Instead, call close_stdout_set_status and arrange to call close_stdout via atexit. --- diff --git a/src/date.c b/src/date.c index 2170899..d8c8f8a 100644 --- a/src/date.c +++ b/src/date.c @@ -191,7 +191,6 @@ the following modifiers between `%%' and a numeric directive.\n\ `_' (underscore) pad the field with spaces\n\ ")); puts (_("\nReport bugs to .")); - close_stdout_status (2); } exit (status); } @@ -320,6 +319,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + close_stdout_set_status (2); + atexit (close_stdout); + while ((optc = getopt_long (argc, argv, "d:f:I::r:Rs:u", long_options, NULL)) != -1) switch (optc) @@ -464,8 +466,6 @@ argument must be a format string beginning with `+'."), show_date (format, when); } - close_stdout_status (2); - exit (status); }