From c8e7d8922310108f2d46189a8f48abcb68e72534 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 21 Aug 2022 12:38:35 +0200 Subject: WIP: Deferred linking of self --- src/execute.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/execute.cc') 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& args, const std::map& env, - bool verbose) + bool verbose, bool terminate) { std::vector 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; -- cgit v1.2.3