mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-10 00:59:28 -06:00
cmUVProcessChain: Simplify representation of merged streams
Pretend the error stream is not connected so clients do not need to have their own conditions to decide whether to read it.
This commit is contained in:
@@ -377,8 +377,7 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
|
||||
outputData.Finished = true;
|
||||
}
|
||||
std::unique_ptr<cmUVStreamReadHandle> errorHandle;
|
||||
if (chain.ErrorStream() >= 0 &&
|
||||
chain.ErrorStream() != chain.OutputStream()) {
|
||||
if (chain.ErrorStream() >= 0) {
|
||||
errorData.Stream.init(chain.GetLoop(), 0);
|
||||
uv_pipe_open(errorData.Stream, chain.ErrorStream());
|
||||
errorHandle = cmUVStreamRead(
|
||||
|
||||
@@ -954,7 +954,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
|
||||
outputHandle =
|
||||
startRead(outStream, chain.OutputStream(), captureStdOut, tempStdOut, 1,
|
||||
cmSystemTools::Stdout, outFinished);
|
||||
if (chain.OutputStream() != chain.ErrorStream()) {
|
||||
if (chain.ErrorStream() >= 0) {
|
||||
errorHandle =
|
||||
startRead(errStream, chain.ErrorStream(), captureStdErr, tempStdErr, 2,
|
||||
cmSystemTools::Stderr, errFinished);
|
||||
|
||||
@@ -261,7 +261,6 @@ bool cmUVProcessChain::InternalData::Prepare(
|
||||
|
||||
case cmUVProcessChainBuilder::Builtin: {
|
||||
if (this->Builder->MergedBuiltinStreams) {
|
||||
errorData.BuiltinStream = outputData.BuiltinStream;
|
||||
errorData.Stdio.flags = UV_INHERIT_FD;
|
||||
errorData.Stdio.data.fd = outputData.Stdio.data.fd;
|
||||
} else {
|
||||
|
||||
@@ -342,13 +342,8 @@ bool testUVProcessChainBuiltinMerged(char const* helperCommand)
|
||||
std::cout << "OutputStream() was invalid, expecting valid" << std::endl;
|
||||
return false;
|
||||
}
|
||||
if (chain->ErrorStream() < 0) {
|
||||
std::cout << "ErrorStream() was invalid, expecting valid" << std::endl;
|
||||
return false;
|
||||
}
|
||||
if (chain->OutputStream() != chain->ErrorStream()) {
|
||||
std::cout << "OutputStream() and ErrorStream() expected to be the same"
|
||||
<< std::endl;
|
||||
if (chain->ErrorStream() >= 0) {
|
||||
std::cout << "ErrorStream() was valid, expecting invalid" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user