summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}