summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-05-13 06:49:53 +0000
committerJim Meyering <jim@meyering.net>2000-05-13 06:49:53 +0000
commit81b16373ae2acf0e585e30b91b0a0dd1ac7883fb (patch)
treebccefed8e59f303dab8b81114d1754977959da7a /src/ls.c
parent47827e2ec298a2d9ab0fb5b367654bb14f080921 (diff)
downloadcoreutils-81b16373ae2acf0e585e30b91b0a0dd1ac7883fb.tar.xz
Arrange to call close_stdout only upon exit.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ls.c b/src/ls.c
index 5728fd1b4..1364abebd 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -774,6 +774,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
#define N_ENTRIES(Array) (sizeof Array / sizeof *(Array))
assert (N_ENTRIES (color_indicator) + 1 == N_ENTRIES (indicator_name));
@@ -873,7 +875,6 @@ main (int argc, char **argv)
put_indicator (&color_indicator[C_RIGHT]);
}
- close_stdout ();
exit (exit_status);
}
@@ -3002,7 +3003,6 @@ optional WHEN argument is equivalent to using --color=always. With\n\
to a terminal (tty).\n\
"));
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
- close_stdout ();
}
exit (status);
}