diff options
Diffstat (limited to 'llvm/lib/System/Unix/Path.inc')
-rw-r--r-- | llvm/lib/System/Unix/Path.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc index e55d9edcf2c..ce0e49127e0 100644 --- a/llvm/lib/System/Unix/Path.inc +++ b/llvm/lib/System/Unix/Path.inc @@ -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 ); } |