mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
LLVM path: Don't follow symlinks. (#48)
This causes issues in recursive_directory_iterator.
This commit is contained in:
@@ -142,6 +142,8 @@ static std::error_code fillStatus(int StatRet, const struct stat &Status,
|
||||
Type = file_type::fifo_file;
|
||||
else if (S_ISSOCK(Status.st_mode))
|
||||
Type = file_type::socket_file;
|
||||
else if (S_ISLNK(Status.st_mode))
|
||||
Type = file_type::symlink_file;
|
||||
|
||||
perms Perms = static_cast<perms>(Status.st_mode);
|
||||
Result =
|
||||
@@ -157,7 +159,7 @@ std::error_code status(const Twine &Path, file_status &Result) {
|
||||
StringRef P = Path.toNullTerminatedStringRef(PathStorage);
|
||||
|
||||
struct stat Status;
|
||||
int StatRet = ::stat(P.begin(), &Status);
|
||||
int StatRet = ::lstat(P.begin(), &Status);
|
||||
return fillStatus(StatRet, Status, Result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user