summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-23 06:56:27 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-23 06:56:27 +0000
commit51edba15c6a11fd79e60039264bee8daa2f14cd0 (patch)
treef005d1dbd5aa2b0c90fb60850774e5b834c96097 /llvm/lib/System/Unix
parent8db844241b25c5a350d3edeeac459fca69c7ae51 (diff)
downloadbcm5719-llvm-51edba15c6a11fd79e60039264bee8daa2f14cd0.tar.gz
bcm5719-llvm-51edba15c6a11fd79e60039264bee8daa2f14cd0.zip
For PR797:
Remove exception throwing from Path::getDirectoryContents and its users. llvm-svn: 29841
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r--llvm/lib/System/Unix/Path.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index 7fc77a99766..2b9f1263ee3 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/lib/System/Unix/Path.inc
@@ -415,10 +415,12 @@ bool Path::makeExecutableOnDisk(std::string* ErrMsg) {
}
bool
-Path::getDirectoryContents(std::set<Path>& result) const {
+Path::getDirectoryContents(std::set<Path>& result, std::string* ErrMsg) const {
DIR* direntries = ::opendir(path.c_str());
- if (direntries == 0)
- ThrowErrno(path + ": can't open directory");
+ if (direntries == 0) {
+ MakeErrMsg(ErrMsg, path + ": can't open directory");
+ return true;
+ }
std::string dirPath = path;
if (!lastIsSlash(dirPath))
@@ -433,14 +435,15 @@ Path::getDirectoryContents(std::set<Path>& result) const {
if (0 != lstat(aPath.path.c_str(), &st)) {
if (S_ISLNK(st.st_mode))
continue; // dangling symlink -- ignore
- ThrowErrno(aPath.path + ": can't determine file object type");
+ MakeErrMsg(ErrMsg, aPath.path + ": can't determine file object type");
+ return true;
}
result.insert(aPath);
}
}
closedir(direntries);
- return true;
+ return false;
}
bool
OpenPOWER on IntegriCloud