mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Fixes IFTODT error while compiling from an android device (#199)
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
This commit is contained in:
parent
b7d26b371a
commit
d11e8277c2
1 changed files with 5 additions and 4 deletions
|
@ -142,6 +142,7 @@ static bool traverseDirectoryRec(const std::string& path, const std::function<vo
|
||||||
joinPaths(buf, path.c_str(), data.d_name);
|
joinPaths(buf, path.c_str(), data.d_name);
|
||||||
|
|
||||||
int type = data.d_type;
|
int type = data.d_type;
|
||||||
|
int mode = -1;
|
||||||
|
|
||||||
// we need to stat DT_UNKNOWN to be able to tell the type
|
// we need to stat DT_UNKNOWN to be able to tell the type
|
||||||
if (type == DT_UNKNOWN)
|
if (type == DT_UNKNOWN)
|
||||||
|
@ -153,18 +154,18 @@ static bool traverseDirectoryRec(const std::string& path, const std::function<vo
|
||||||
lstat(buf.c_str(), &st);
|
lstat(buf.c_str(), &st);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
type = IFTODT(st.st_mode);
|
mode = st.st_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == DT_DIR)
|
if (type == DT_DIR || mode == S_IFDIR)
|
||||||
{
|
{
|
||||||
traverseDirectoryRec(buf, callback);
|
traverseDirectoryRec(buf, callback);
|
||||||
}
|
}
|
||||||
else if (type == DT_REG)
|
else if (type == DT_REG || mode == S_IFREG)
|
||||||
{
|
{
|
||||||
callback(buf);
|
callback(buf);
|
||||||
}
|
}
|
||||||
else if (type == DT_LNK)
|
else if (type == DT_LNK || mode == S_IFLNK)
|
||||||
{
|
{
|
||||||
// Skip symbolic links to avoid handling cycles
|
// Skip symbolic links to avoid handling cycles
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue