Do not mark directories as `executable', we only want program files

Patch by Markus Oberhumer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman 2005-04-20 15:33:22 +00:00
parent baec07cbfe
commit 8177bf8904

View File

@ -311,6 +311,10 @@ Path::writable() const {
bool
Path::executable() const {
struct stat st;
int r = stat(path.c_str(), &st);
if (r != 0 || !S_ISREG(st.st_mode))
return false;
return 0 == access(path.c_str(), R_OK | X_OK );
}