From f6f3be69d81e8e41f90de9913738a9ba11190221 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 19 Jun 2013 13:25:31 +0000 Subject: Remove Path::canExecute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184298 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Path.inc | 12 ------------ lib/Support/Windows/Path.inc | 7 ------- 2 files changed, 19 deletions(-) (limited to 'lib') diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index fad2697cdb..f3e4b61056 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -338,18 +338,6 @@ Path::isRegularFile() const { return false; } -bool -Path::canExecute() const { - if (0 != access(path.c_str(), R_OK | X_OK )) - return false; - struct stat buf; - if (0 != stat(path.c_str(), &buf)) - return false; - if (!S_ISREG(buf.st_mode)) - return false; - return true; -} - const FileStatus * PathWithStatus::getFileStatus(bool update, std::string *ErrStr) const { if (!fsIsValid || update) { diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index de33fdbc6f..6b1e0f2bac 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -243,13 +243,6 @@ Path::isSymLink() const { return attributes & FILE_ATTRIBUTE_REPARSE_POINT; } -bool -Path::canExecute() const { - // FIXME: take security attributes into account. - DWORD attr = GetFileAttributes(path.c_str()); - return attr != INVALID_FILE_ATTRIBUTES; -} - bool Path::isRegularFile() const { bool res; -- cgit v1.2.3