mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Remove duplication in Program::Execute{And,No}Wait.
Implemented by moving the code out of static functions into methods of Program class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76340 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -22,6 +22,33 @@ using namespace sys;
|
||||
//=== independent code.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
int
|
||||
Program::ExecuteAndWait(const Path& path,
|
||||
const char** args,
|
||||
const char** envp,
|
||||
const Path** redirects,
|
||||
unsigned secondsToWait,
|
||||
unsigned memoryLimit,
|
||||
std::string* ErrMsg) {
|
||||
Program prg;
|
||||
if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg))
|
||||
return prg.Wait(secondsToWait, ErrMsg);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
void
|
||||
Program::ExecuteNoWait(const Path& path,
|
||||
const char** args,
|
||||
const char** envp,
|
||||
const Path** redirects,
|
||||
unsigned memoryLimit,
|
||||
std::string* ErrMsg) {
|
||||
Program prg;
|
||||
prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Include the platform-specific parts of this class.
|
||||
|
Reference in New Issue
Block a user