about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 27116fd18297..d1b67c6d4515 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -232,7 +232,11 @@ DirEntries readDirectory(const Path & path)
         checkInterrupt();
         string name = dirent->d_name;
         if (name == "." || name == "..") continue;
+#ifdef HAVE_STRUCT_DIRENT_D_TYPE
         entries.emplace_back(name, dirent->d_ino, dirent->d_type);
+#else
+        entries.emplace_back(name, dirent->d_ino, getFileType(absPath(name, path)));
+#endif
     }
     if (errno) throw SysError(format("reading directory ‘%1%’") % path);