Determine if path is directory for XFS filesystem

The dir_result->d_type == DT_DIR does not work on XFS file systems.

This is fixed by using the FileLister::isDirectory when dir_result->d_type == DT_UNKNOWN.

According to readdir_r documentation, the case where d_type == DT_UNKNOWN should be handled.
This commit is contained in:
Lau bakman 2016-01-20 12:55:48 +01:00
parent 642cc57428
commit 53f07c1423
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ static void addFiles2(std::map<std::string, std::size_t> &files,
new_path = path + '/' + dir_result->d_name;
if (dir_result->d_type == DT_DIR) {
if (dir_result->d_type == DT_DIR || (dir_result->d_type == DT_UNKNOWN && FileLister::isDirectory(new_path))) {
if (recursive && !ignored.Match(new_path)) {
addFiles2(files, new_path, extra, recursive, ignored);
}