Skip to content

Commit

Permalink
Create new process group
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Apr 2, 2024
1 parent e817d54 commit ee96f51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/gz/utils/Subprocess.hh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Subprocess
{
}


/// \brief Create a subprocess
private: void Create()
{
if (this->process != nullptr)
Expand Down
2 changes: 2 additions & 0 deletions include/gz/utils/detail/subprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ int subprocess_create_ex(const char *const commandLine[], int options,
const unsigned long startFUseStdHandles = 0x00000100;
const unsigned long handleFlagInherit = 0x00000001;
const unsigned long createNoWindow = 0x08000000;
const unsigned long createNewProcessGroup = 0x00000200;
struct subprocess_subprocess_information_s processInfo;
struct subprocess_security_attributes_s saAttr = {sizeof(saAttr),
SUBPROCESS_NULL, 1};
Expand All @@ -523,6 +524,7 @@ int subprocess_create_ex(const char *const commandLine[], int options,
startInfo.cb = sizeof(startInfo);
startInfo.dwFlags = startFUseStdHandles;

flags |= createNewProcessGroup;
if (subprocess_option_no_window == (options & subprocess_option_no_window)) {
flags |= createNoWindow;
}
Expand Down

0 comments on commit ee96f51

Please sign in to comment.