summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix/Path.inc
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-22 23:27:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-22 23:27:23 +0000
commit9d2f19c7e47e758be119027f16e4fc1b039271f7 (patch)
tree78eac4c0057f94feb2a32cac0531043939eb8efc /llvm/lib/System/Unix/Path.inc
parent9afdac4a559655fe11e24b031fa081951eb0b0f3 (diff)
downloadbcm5719-llvm-9d2f19c7e47e758be119027f16e4fc1b039271f7.tar.gz
bcm5719-llvm-9d2f19c7e47e758be119027f16e4fc1b039271f7.zip
For PR797:
Change the Path::make*OnDisk methods exception free and adjust their usage. llvm-svn: 29836
Diffstat (limited to 'llvm/lib/System/Unix/Path.inc')
-rw-r--r--llvm/lib/System/Unix/Path.inc27
1 files changed, 18 insertions, 9 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index b1e51b0aff9..db7f4c6fabf 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/lib/System/Unix/Path.inc
@@ -390,19 +390,28 @@ static bool AddPermissionBits(const Path &File, int bits) {
return true;
}
-void Path::makeReadableOnDisk() {
- if (!AddPermissionBits(*this, 0444))
- ThrowErrno(path + ": can't make file readable");
+bool Path::makeReadableOnDisk(std::string* ErrMsg) {
+ if (!AddPermissionBits(*this, 0444)) {
+ MakeErrMsg(ErrMsg, path + ": can't make file readable");
+ return true;
+ }
+ return false;
}
-void Path::makeWriteableOnDisk() {
- if (!AddPermissionBits(*this, 0222))
- ThrowErrno(path + ": can't make file writable");
+bool Path::makeWriteableOnDisk(std::string* ErrMsg) {
+ if (!AddPermissionBits(*this, 0222)) {
+ MakeErrMsg(ErrMsg, path + ": can't make file writable");
+ return true;
+ }
+ return false;
}
-void Path::makeExecutableOnDisk() {
- if (!AddPermissionBits(*this, 0111))
- ThrowErrno(path + ": can't make file executable");
+bool Path::makeExecutableOnDisk(std::string* ErrMsg) {
+ if (!AddPermissionBits(*this, 0111)) {
+ MakeErrMsg(ErrMsg, path + ": can't make file executable");
+ return true;
+ }
+ return false;
}
bool
OpenPOWER on IntegriCloud