diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-22 23:27:23 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-22 23:27:23 +0000 |
commit | e1647f46982c67b68f40ec6d775f165cacf0a9dc (patch) | |
tree | e78e8d9f6a67fb5283d8e6c4cd83ddbddc9bac93 /lib/System | |
parent | ab96bb1df3987b94fcd897e97f917ecd064deed3 (diff) | |
download | external_llvm-e1647f46982c67b68f40ec6d775f165cacf0a9dc.zip external_llvm-e1647f46982c67b68f40ec6d775f165cacf0a9dc.tar.gz external_llvm-e1647f46982c67b68f40ec6d775f165cacf0a9dc.tar.bz2 |
For PR797:
Change the Path::make*OnDisk methods exception free and adjust their usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Unix/Path.inc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index b1e51b0..db7f4c6 100644 --- a/lib/System/Unix/Path.inc +++ b/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 |