diff options
author | Jim Meyering <jim@meyering.net> | 2000-05-11 07:24:05 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-05-11 07:24:05 +0000 |
commit | 9590fbf43cc6f254c305e25792f92d5f69bfbdba (patch) | |
tree | 4bfd3b1f099331284ba91e334d3a3d0c0a83cb56 /src/tty.c | |
parent | 5a3d9df9a1dba883bb662591e4a638158f6db678 (diff) | |
download | coreutils-9590fbf43cc6f254c305e25792f92d5f69bfbdba.tar.xz |
(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.
Diffstat (limited to 'src/tty.c')
-rw-r--r-- | src/tty.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -69,7 +69,6 @@ Print the file name of the terminal connected to standard input.\n\ ")); puts (_("\nReport bugs to <bug-sh-utils@gnu.org>.")); } - close_stdout_status (3); exit (status); } @@ -84,6 +83,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + close_stdout_set_status (3); + atexit (close_stdout); + silent = 0; while ((optc = getopt_long (argc, argv, "s", longopts, NULL)) != -1) @@ -116,8 +118,6 @@ main (int argc, char **argv) puts (tty); else puts (_("not a tty")); - - close_stdout_status (3); } exit (isatty (0) ? 0 : 1); |