(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.
#include "ftw.h"
#include "hash.h"
#include "human.h"
+#include "mmap-stack.h"
#include "quote.h"
#include "quotearg.h"
#include "same.h"
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;
if (print_totals)
print_size (tot_size, _("total"));
- return fail;
+ exit (fail || G_fail ? EXIT_FAILURE : EXIT_SUCCESS);
}
int
/* 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);
}