From 4aa92466eb8abc40c54c5d937396df6a3107df9f Mon Sep 17 00:00:00 2001 From: DaanDeMeyer Date: Sat, 16 Dec 2017 17:32:10 +0100 Subject: [PATCH] Fix IsSymLink on Linux (#147) IsSymlink was giving faulty results when finding recursive files on Linux. I've updated the function to use the built-in POSIX macro for checking if a file is a symlink. --- src/platform_linux.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform_linux.cc b/src/platform_linux.cc index 1e7b37bc..f2d7dd9d 100644 --- a/src/platform_linux.cc +++ b/src/platform_linux.cc @@ -335,7 +335,7 @@ bool IsSymLink(const std::string& path) { struct stat buf; int result; result = lstat(path.c_str(), &buf); - return result == 0; + return S_ISLNK(buf.st_mode); } std::vector GetPlatformClangArguments() {