Skip to content
Snippets Groups Projects
Commit faff2ab0 authored by James Johnston's avatar James Johnston Committed by Brad King
Browse files

Process: Wait for children to terminate on Ctrl+C.

The following applies to any KWSys console app on Windows or UNIX
(e.g. cmake.exe):  The default behavior of such an app when Ctrl+C is
pressed is to call ExitProcess or _exit.  If the user has a
subprocess open (e.g. by way of cmake --build) when this happens, the
subprocess will be orphaned because the kwsys-based program will
immediately exit.  This can lead to odd behavior such as the orphaned
subprocess continuing to run and mix output with the operating system
shell.  We prevent this behavior on Windows by tracking all
subprocesses and waiting for their termination when Ctrl+C is pressed
before allowing the call to ExitProcess to proceed.  On UNIX, we reap
every single child process and then call _exit.

Change-Id: Iebd2eedb1c06719e9797dd5b1309d473145476a8
parent b1c44c58
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment