Skip to content

Ensure stdin, stdout, and stderr pipes are always open

Brad King requested to merge brad.king/cmake:std-pipes-always into master

On non-Windows platforms libuv assumes that file descriptors 0-2 are always used for standard pipes and never for anything else. Otherwise, libuv may re-use one of these descriptors and then fail an assertion when closing it. Similarly, On Windows platforms our ConsoleBuf implementation assumes that the standard handles are always open.

If CMake is run with any standard pipes closed, open them with /dev/null or NUL to satisfy these assumptions.

Fixes: #19219 (closed)

Edited by Brad King

Merge request reports