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

Patch by Markus Oberhumer.

llvm-svn: 21377
This commit is contained in:
Misha Brukman 2005-04-20 15:33:22 +00:00
parent ee6770f1a3
commit a9a8c1b65b
1 changed files with 4 additions and 0 deletions

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 );
}