summaryrefslogtreecommitdiff
path: root/src/cp.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/cp.c
parent47827e2ec298a2d9ab0fb5b367654bb14f080921 (diff)
downloadcoreutils-81b16373ae2acf0e585e30b91b0a0dd1ac7883fb.tar.xz
Arrange to call close_stdout only upon exit.
Diffstat (limited to 'src/cp.c')
-rw-r--r--src/cp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cp.c b/src/cp.c
index b39db1da6..e4565d320 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -201,7 +201,6 @@ options are given and SOURCE and DEST are the same name for an existing,\n\
regular file.\n\
"));
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
- close_stdout ();
}
exit (status);
}
@@ -683,6 +682,8 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ atexit (close_stdout);
+
cp_option_init (&x);
/* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless
@@ -835,7 +836,5 @@ main (int argc, char **argv)
exit_status |= do_copy (argc - optind, argv + optind, target_directory, &x);
- if (x.verbose)
- close_stdout ();
exit (exit_status);
}