summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/src/experimental/filesystem/directory_iterator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/src/experimental/filesystem/directory_iterator.cpp b/libcxx/src/experimental/filesystem/directory_iterator.cpp
index c95ebc8ac34..7a1ab257354 100644
--- a/libcxx/src/experimental/filesystem/directory_iterator.cpp
+++ b/libcxx/src/experimental/filesystem/directory_iterator.cpp
@@ -42,8 +42,11 @@ static file_type get_file_type(DirEntT *ent, int) {
return file_type::regular;
case DT_SOCK:
return file_type::socket;
+ // Unlike in lstat, hitting "unknown" here simply means that the underlying
+ // filesystem doesn't support d_type. Report is as 'none' so we correctly
+ // set the cache to empty.
case DT_UNKNOWN:
- return file_type::unknown;
+ break;
}
return file_type::none;
}
OpenPOWER on IntegriCloud