mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
Add a boolean parameter to the ExecuteAndWait static function to indicated
if execution failed. ExecuteAndWait returns -1 upon an execution failure, but checking the return value isn't sufficient because the wait command may return -1 as well. This new parameter is to be used by the clang driver in a subsequent commit. Part of rdar://13362359 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178087 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
39c41c3c93
commit
847e36fb60
@ -125,7 +125,8 @@ namespace sys {
|
|||||||
const sys::Path** redirects = 0,
|
const sys::Path** redirects = 0,
|
||||||
unsigned secondsToWait = 0,
|
unsigned secondsToWait = 0,
|
||||||
unsigned memoryLimit = 0,
|
unsigned memoryLimit = 0,
|
||||||
std::string* ErrMsg = 0);
|
std::string* ErrMsg = 0,
|
||||||
|
bool *ExecutionFailed = 0);
|
||||||
|
|
||||||
/// A convenience function equivalent to Program prg; prg.Execute(..);
|
/// A convenience function equivalent to Program prg; prg.Execute(..);
|
||||||
/// @see Execute
|
/// @see Execute
|
||||||
|
@ -29,11 +29,14 @@ Program::ExecuteAndWait(const Path& path,
|
|||||||
const Path** redirects,
|
const Path** redirects,
|
||||||
unsigned secondsToWait,
|
unsigned secondsToWait,
|
||||||
unsigned memoryLimit,
|
unsigned memoryLimit,
|
||||||
std::string* ErrMsg) {
|
std::string* ErrMsg,
|
||||||
|
bool *ExecutionFailed) {
|
||||||
Program prg;
|
Program prg;
|
||||||
if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg))
|
if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg)) {
|
||||||
|
if (ExecutionFailed) *ExecutionFailed = false;
|
||||||
return prg.Wait(path, secondsToWait, ErrMsg);
|
return prg.Wait(path, secondsToWait, ErrMsg);
|
||||||
else
|
}
|
||||||
|
if (ExecutionFailed) *ExecutionFailed = true;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user