[llvm-commits] CVS: llvm/lib/System/Unix/Path.inc

Misha Brukman brukman at cs.uiuc.edu
Wed Apr 20 08:33:33 PDT 2005



Changes in directory llvm/lib/System/Unix:

Path.inc updated: 1.31 -> 1.32
---
Log message:

Do not mark directories as `executable', we only want program files
Patch by Markus Oberhumer.


---
Diffs of the changes:  (+4 -0)

 Path.inc |    4 ++++
 1 files changed, 4 insertions(+)


Index: llvm/lib/System/Unix/Path.inc
diff -u llvm/lib/System/Unix/Path.inc:1.31 llvm/lib/System/Unix/Path.inc:1.32
--- llvm/lib/System/Unix/Path.inc:1.31	Tue Apr 19 23:04:07 2005
+++ llvm/lib/System/Unix/Path.inc	Wed Apr 20 10:33:22 2005
@@ -311,6 +311,10 @@
 
 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 );
 }
 






More information about the llvm-commits mailing list