diff options
author | Jim Meyering <jim@meyering.net> | 2003-02-19 22:20:45 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-02-19 22:20:45 +0000 |
commit | ac823e21c01e063b28a146cfb06477db7a989b12 (patch) | |
tree | beb0dd7e89456c35021c27a1041be13feb632501 | |
parent | 5c6facc555b6b8dbb8239c87d684ac0c9112f9bc (diff) | |
download | coreutils-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.
-rw-r--r-- | src/du.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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); } |