From: Jim Meyering Date: Sat, 1 Feb 2003 15:20:36 +0000 (+0000) Subject: (MAX_N_DESCRIPTORS): Define. X-Git-Tag: v4.5.5~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d606b4759829e44f3c03aaa0d46ad67c1136a1a5;p=thirdparty%2Fcoreutils.git (MAX_N_DESCRIPTORS): Define. --- diff --git a/src/du.c b/src/du.c index 7fe4746d4b..eda233b02b 100644 --- a/src/du.c +++ b/src/du.c @@ -51,8 +51,12 @@ /* Initial size of the hash table. */ #define INITIAL_TABLE_SIZE 103 -/* Initial size to allocate for `path'. */ -#define INITIAL_PATH_SIZE 100 +/* The maximum number of simultaneously open file handles that + may be used by ftw. */ +#define MAX_N_DESCRIPTORS \ + (UTILS_OPEN_MAX < 20 \ + ? UTILS_OPEN_MAX \ + : UTILS_OPEN_MAX - 10) /* Hash structure for inode and device numbers. The separate entry structure makes it easier to rehash "in place". */ @@ -515,7 +519,6 @@ du_files (char **files, int ftw_flags) file = new_file; } -#define MAX_N_DESCRIPTORS (1000 - 1) /* FIXME-compute at configure time */ err = nftw (file, process_file, MAX_N_DESCRIPTORS, ftw_flags); if (err) error (0, errno, "%s", quote (orig));