aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@auroraux.org>2009-11-25 06:32:19 +0000
committerEdward O'Callaghan <eocallaghan@auroraux.org>2009-11-25 06:32:19 +0000
commite49a8e4db92bf8b92f5fa6a13b7c17837c1762de (patch)
tree6908b7b16e4bc528c16fd78ece9e154d2e3f07dd /lib/System
parentb3587cfb3bd2de1675836eca8802661d32d6eb4d (diff)
downloadexternal_llvm-e49a8e4db92bf8b92f5fa6a13b7c17837c1762de.zip
external_llvm-e49a8e4db92bf8b92f5fa6a13b7c17837c1762de.tar.gz
external_llvm-e49a8e4db92bf8b92f5fa6a13b7c17837c1762de.tar.bz2
API change Path::isSpecialFile to Path::isRegularFile, improve semantics in regards to comments from 89765 post review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Unix/Path.inc10
-rw-r--r--lib/System/Win32/Path.inc6
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index 8dd76a7..4300d67 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -454,17 +454,17 @@ Path::canWrite() const {
}
bool
-Path::isSpecialFile() const {
+Path::isRegularFile() const {
// Get the status so we can determine if its a file or directory
struct stat buf;
if (0 != stat(path.c_str(), &buf))
- return true;
-
- if (S_ISDIR(buf.st_mode) || S_ISREG(buf.st_mode))
return false;
- return true;
+ if (S_ISREG(buf.st_mode))
+ return true;
+
+ return false;
}
bool
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 9adeca2..634fbc7 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -358,8 +358,10 @@ Path::canExecute() const {
}
bool
-Path::isSpecialFile() const {
- return false;
+Path::isRegularFile() const {
+ if (isDirectory())
+ return false;
+ return true;
}
std::string