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 /tools/gccld | |
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 'tools/gccld')
-rw-r--r-- | tools/gccld/gccld.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index a9df06d..c8ecde5 100644 --- a/tools/gccld/gccld.cpp +++ b/tools/gccld/gccld.cpp @@ -385,13 +385,23 @@ int main(int argc, char **argv, char **envp ) { EmitShellScript(argv); // Make the bytecode file readable and directly executable in LLEE - sys::Path(RealBytecodeOutput).makeExecutableOnDisk(); - sys::Path(RealBytecodeOutput).makeReadableOnDisk(); + std::string ErrMsg; + if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } + if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } } // Make the output, whether native or script, executable as well... - sys::Path(OutputFilename).makeExecutableOnDisk(); - + std::string ErrMsg; + if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } } catch (const char*msg) { std::cerr << argv[0] << ": " << msg << "\n"; exitCode = 1; |