diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-07-18 21:43:12 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-07-18 21:43:12 +0000 |
commit | 3140619c63d205d79b8eac1d88afa918981fa258 (patch) | |
tree | 24b3dc75a8edeed8867f7aa5c4c6aadb52063881 /lib/System/Program.cpp | |
parent | 617dd7baa6dfd3a7b5ee72ace37f6b6aeaa6006b (diff) |
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
Diffstat (limited to 'lib/System/Program.cpp')
-rw-r--r-- | lib/System/Program.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/System/Program.cpp b/lib/System/Program.cpp index eb289d81b2..a3049d46fd 100644 --- a/lib/System/Program.cpp +++ b/lib/System/Program.cpp @@ -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. |