summaryrefslogtreecommitdiff
path: root/src/du.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-01-04 22:45:28 +0000
committerJim Meyering <jim@meyering.net>1998-01-04 22:45:28 +0000
commit5d4f8ebdfda9a4aadaeb30aebd34542e55bc13e1 (patch)
treeebcd4ea3aeb95093c8658d1442ee10612a29f438 /src/du.c
parentb246280c27644ec0f08909d33e652cabb6b16981 (diff)
downloadcoreutils-5d4f8ebdfda9a4aadaeb30aebd34542e55bc13e1.tar.xz
(main, usage): Check for write error to stdout before exiting.
Include "closeout.h".
Diffstat (limited to 'src/du.c')
-rw-r--r--src/du.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/du.c b/src/du.c
index eee05318a..165d0dfd8 100644
--- a/src/du.c
+++ b/src/du.c
@@ -1,5 +1,5 @@
/* du -- summarize disk usage
- Copyright (C) 88, 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 88, 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,6 +54,7 @@
#include "exclude.h"
#include "system.h"
#include "save-cwd.h"
+#include "closeout.h"
#include "error.h"
#include "human.h"
#include "xstrtol.h"
@@ -238,6 +239,7 @@ Summarize disk usage of each FILE, recursively for directories.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
+ close_stdout ();
}
exit (status);
}
@@ -372,6 +374,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("du (%s) %s\n", GNU_PACKAGE, VERSION);
+ close_stdout ();
exit (0);
}
@@ -405,6 +408,7 @@ main (int argc, char **argv)
du_files (optind == argc ? cwd_only : argv + optind);
+ close_stdout ();
exit (exit_status);
}