diff options
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/util.cc | 2 | ||||
-rw-r--r-- | src/libutil/util.hh | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 75032bf90..c1585e27e 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -232,7 +232,7 @@ DirEntries readDirectory(const Path & path) checkInterrupt(); string name = dirent->d_name; if (name == "." || name == "..") continue; - entries.emplace_back(name, dirent->d_ino, dirent->d_type); + entries.emplace_back(name, dirent->d_ino, #ifdef HAVE_STRUCT_DIRENT_D_TYPE dirent->d_type #else DT_UNKNOWN #endif); } if (errno) throw SysError(format("reading directory ‘%1%’") % path); diff --git a/src/libutil/util.hh b/src/libutil/util.hh index f4026a0a8..cf93c6378 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -11,6 +11,12 @@ #include <cstdio> +#ifndef HAVE_STRUCT_DIRENT_D_TYPE +#define DT_UNKNOWN 0 +#define DT_REG 1 +#define DT_LNK 2 +#define DT_DIR 3 +#endif namespace nix { |