OSDN Git Service

[fs] Make sure to check S_ISLNK() in fillStatus.
authorZachary Turner <zturner@google.com>
Tue, 7 Mar 2017 17:48:47 +0000 (17:48 +0000)
committerZachary Turner <zturner@google.com>
Tue, 7 Mar 2017 17:48:47 +0000 (17:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297167 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Unix/Path.inc

index 05636f8..76e1ed2 100644 (file)
@@ -500,6 +500,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 =