diff options
author | Jim Meyering <jim@meyering.net> | 2003-10-17 11:12:11 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-10-17 11:12:11 +0000 |
commit | 433a4c3059046642b0b79f9e6e9f0d8242e0117f (patch) | |
tree | 657b83d8cd1219cf141ab32bc97eb5841b74a612 /src | |
parent | a0f90d02909773ae69656c9d041426ab7fc65c45 (diff) | |
download | coreutils-433a4c3059046642b0b79f9e6e9f0d8242e0117f.tar.xz |
Include "xfts.h".
(du_files): Use xfts_open, rather than fts_open.
Diffstat (limited to 'src')
-rw-r--r-- | src/du.c | 24 |
1 files changed, 2 insertions, 22 deletions
@@ -34,12 +34,12 @@ #include "dirname.h" /* for strip_trailing_slashes */ #include "error.h" #include "exclude.h" -#include "fts_.h" #include "hash.h" #include "human.h" #include "quote.h" #include "quotearg.h" #include "same.h" +#include "xfts.h" #include "xstrtol.h" /* The official name of this program (e.g., no `g' prefix). */ @@ -472,27 +472,7 @@ du_files (char **files, int bit_flags) { int fail = 0; - FTS *fts = fts_open (files, bit_flags, NULL); - if (fts == NULL) - { - /* This can fail in three ways: out of memory, invalid bit_flags, - and one or more of the FILES is an empty string. We could try - to decipher that errno==EINVAL means invalid bit_flags and - errno==ENOENT means there's an empty string, but that seems wrong. - Ideally, fts_open would return a proper error indicator. For now, - we'll presume that the bit_flags are valid and just check for - empty strings. */ - bool invalid_arg = false; - for (; *files; ++files) - { - if (**files == '\0') - invalid_arg = true; - } - if (invalid_arg) - error (EXIT_FAILURE, 0, _("invalid argument: %s"), quote ("")); - else - xalloc_die (); - } + FTS *fts = xfts_open (files, bit_flags, NULL); while (1) { |