diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-08-21 12:38:35 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-08-21 12:50:45 +0200 |
commit | c8e7d8922310108f2d46189a8f48abcb68e72534 (patch) | |
tree | d29ae8b8da4e10a88344f0412cc7bb3ea0539344 /src/execute.cc | |
parent | 33f70be85ef83b0ebeaa6755b67558ae2f5ae8e6 (diff) |
WIP: Deferred linking of self
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; |