mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-01 18:33:56 +00:00
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:
parent
baec07cbfe
commit
8177bf8904
@ -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 );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user