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/?a=commitdiff_plain;h=bff9d86e0e0ccf23ce4c34024fa2fc33e1f8ff68;p=libs%2Fcore.git 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?