diff options
Diffstat (limited to 'src/execute.cc')
-rw-r--r-- | src/execute.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/execute.cc b/src/execute.cc index 5e59ff6..85c1da1 100644 --- a/src/execute.cc +++ b/src/execute.cc @@ -44,7 +44,7 @@ int parent_waitpid(pid_t pid) int execute(const std::string& command, const std::vector<std::string>& args, const std::map<std::string, std::string>& env, - bool verbose) + bool verbose, bool terminate) { std::vector<const char*> argv; argv.push_back(command.data()); @@ -176,6 +176,10 @@ int execute(const std::string& command, return 1; // Could not start process; } + if(terminate) + { + ExitProcess(0); + } // Now 'pi.hProcess' contains the process HANDLE, which you can use to // wait for it like this: const DWORD infinite = 0xFFFFFFFF; |