summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-10-07 22:05:57 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-10-07 22:05:57 +0000
commit139edad73abe7c6a9c552faa1b8121168f4271eb (patch)
treed53078a2de20ed45527c1d38bc9e0809c21f7908 /llvm/lib/System
parent251f859b2321b5cc82dee7249dda4a19a4388bb0 (diff)
downloadbcm5719-llvm-139edad73abe7c6a9c552faa1b8121168f4271eb.tar.gz
bcm5719-llvm-139edad73abe7c6a9c552faa1b8121168f4271eb.zip
Correctly check if a path is a directory. Fix by Brian Korver.
llvm-svn: 115991
Diffstat (limited to 'llvm/lib/System')
-rw-r--r--llvm/lib/System/Unix/Path.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index 184da1e27ac..4c97c4b71cc 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/lib/System/Unix/Path.inc
@@ -439,7 +439,7 @@ Path::isDirectory() const {
struct stat buf;
if (0 != stat(path.c_str(), &buf))
return false;
- return buf.st_mode & S_IFDIR ? true : false;
+ return ((buf.st_mode & S_IFMT) == S_IFDIR) ? true : false;
}
bool
OpenPOWER on IntegriCloud