From 5fc7fadf84bd1cd70453ed6020b28f2858a8107b Mon Sep 17 00:00:00 2001 From: vahtis Date: Tue, 8 Jan 2019 22:17:04 +0200 Subject: [PATCH] SunOs 11 compatibility with dirent (#1574) * SunOs 11 compatibility issue solved. Member d_type is a BSD extension * Added test for BSD also. * Extra empty lines removed --- cli/filelister.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/filelister.cpp b/cli/filelister.cpp index e7e6677d7..f80ce060c 100644 --- a/cli/filelister.cpp +++ b/cli/filelister.cpp @@ -202,7 +202,12 @@ static void addFiles2(std::map &files, new_path = path + '/' + dir_result->d_name; - if (dir_result->d_type == DT_DIR || (dir_result->d_type == DT_UNKNOWN && FileLister::isDirectory(new_path))) { +#if defined(_DIRENT_HAVE_D_TYPE) || defined(_BSD_SOURCE) + bool path_is_directory = (dir_result->d_type == DT_DIR || (dir_result->d_type == DT_UNKNOWN && FileLister::isDirectory(new_path))); +#else + bool path_is_directory = FileLister::isDirectory(new_path); +#endif + if (path_is_directory) { if (recursive && !ignored.match(new_path)) { addFiles2(files, new_path, extra, recursive, ignored); }