From: Mikko Rasa Date: Sun, 22 Aug 2021 09:39:59 +0000 (+0300) Subject: Enable inheriting handles in CreateProcess X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=bff9d86e0e0ccf23ce4c34024fa2fc33e1f8ff68;hp=8bbba6b8cd02c33612fb173e6df48b130407af8f Enable inheriting handles in CreateProcess --- diff --git a/source/core/windows/process.cpp b/source/core/windows/process.cpp index d6d1484..6123fa7 100644 --- a/source/core/windows/process.cpp +++ b/source/core/windows/process.cpp @@ -80,7 +80,7 @@ void Process::execute(const string &command, bool path_search, const Arguments & } const char *cmdptr = (path_search ? 0 : command.c_str()); const char *wd = (work_dir.empty() ? 0 : work_dir.c_str()); - if(!CreateProcess(cmdptr, const_cast(cmdline.c_str()), 0, 0, false, 0, 0, wd, &startup, &priv->info)) + if(!CreateProcess(cmdptr, const_cast(cmdline.c_str()), 0, 0, true, 0, 0, wd, &startup, &priv->info)) throw system_error("CreateProcess"); // XXX Should we close the duplicated handles? What if CreateProcess fails?