1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

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 7f8c9b4840
commit 11854af05f

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