summaryrefslogtreecommitdiff
path: root/src/du.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-02-19 22:20:45 +0000
committerJim Meyering <jim@meyering.net>2003-02-19 22:20:45 +0000
commitac823e21c01e063b28a146cfb06477db7a989b12 (patch)
treebeb0dd7e89456c35021c27a1041be13feb632501 /src/du.c
parent5c6facc555b6b8dbb8239c87d684ac0c9112f9bc (diff)
downloadcoreutils-ac823e21c01e063b28a146cfb06477db7a989b12.tar.xz
Include "mmap-stack.h".
(du_files): Add prototype with ATTRIBUTE_NORETURN. Exit from this function, not from... (main): ...here. Instead, if possible, invoke du_files through a macro that runs it with a large, mmap'd stack.
Diffstat (limited to 'src/du.c')
-rw-r--r--src/du.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/du.c b/src/du.c
index fbc07b534..95aa4d98c 100644
--- a/src/du.c
+++ b/src/du.c
@@ -37,6 +37,7 @@
#include "ftw.h"
#include "hash.h"
#include "human.h"
+#include "mmap-stack.h"
#include "quote.h"
#include "quotearg.h"
#include "same.h"
@@ -497,7 +498,8 @@ is_symlink_to_dir (char const *file)
FTW_FLAGS controls how nftw works.
Return nonzero upon error. */
-static int
+static void du_files (char **files, int ftw_flags) ATTRIBUTE_NORETURN;
+static void
du_files (char **files, int ftw_flags)
{
int fail = 0;
@@ -544,7 +546,7 @@ du_files (char **files, int ftw_flags)
if (print_totals)
print_size (tot_size, _("total"));
- return fail;
+ exit (fail || G_fail ? EXIT_FAILURE : EXIT_SUCCESS);
}
int
@@ -716,6 +718,5 @@ main (int argc, char **argv)
/* Initialize the hash structure for inode numbers. */
hash_init ();
- exit (du_files (files, ftw_flags) || G_fail
- ? EXIT_FAILURE : EXIT_SUCCESS);
+ RUN_WITH_BIG_STACK_2 (du_files, files, ftw_flags);
}