forked from OSchip/llvm-project
Do not mark directories as `executable', we only want program files
Patch by Markus Oberhumer. llvm-svn: 21377
This commit is contained in:
parent
ee6770f1a3
commit
a9a8c1b65b
|
@ -311,6 +311,10 @@ Path::writable() const {
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Path::executable() const {
|
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 );
|
return 0 == access(path.c_str(), R_OK | X_OK );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue