diff options
author | Brad King <brad.king@kitware.com> | 2019-05-02 15:11:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-02 18:34:58 (GMT) |
commit | c85524a94ace9ee400229fede179a605b1c144e3 (patch) | |
tree | dd6d26483bef6d6fddd0e5a488762d9e5757e952 /Source/cmSystemTools.h | |
parent | ce79364581643700ab88ee4c442e0cf1736c926e (diff) | |
download | CMake-c85524a94ace9ee400229fede179a605b1c144e3.zip CMake-c85524a94ace9ee400229fede179a605b1c144e3.tar.gz CMake-c85524a94ace9ee400229fede179a605b1c144e3.tar.bz2 |
Ensure stdin, stdout, and stderr pipes are always open
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
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 05bd351..8a87a37 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -435,6 +435,8 @@ public: // not get stuck waiting for all the output on the pipes. static void DoNotInheritStdPipes(); + static void EnsureStdPipes(); + /** Copy the file create/access/modify times from the file named by the first argument to that named by the second. */ static bool CopyFileTime(const std::string& fromFile, |