summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-24 15:07:54 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-24 21:59:49 (GMT)
commitb6e4e4babcdc6b44a1d494c4e9c07634c2b3bcd6 (patch)
tree98d4ead44dc511d27dace599003db68c6be72423 /Source/cmSystemTools.cxx
parent116bb2b70f87276515f9b64937502ce6c8754cbd (diff)
downloadCMake-b6e4e4babcdc6b44a1d494c4e9c07634c2b3bcd6.zip
CMake-b6e4e4babcdc6b44a1d494c4e9c07634c2b3bcd6.tar.gz
CMake-b6e4e4babcdc6b44a1d494c4e9c07634c2b3bcd6.tar.bz2
cmUVProcessChain: Simplify SetExternalStream usage
It is commonly called with the `fileno()` of a `FILE*` stream, so accept the latter directly.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index f606c22..1f5333f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -25,8 +25,6 @@
#include <cm3p/uv.h>
-#include "cm_fileno.hxx"
-
#include "cmDuration.h"
#include "cmELF.h"
#include "cmMessageMetadata.h"
@@ -576,8 +574,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
cmDuration timeout, Encoding encoding)
{
cmUVProcessChainBuilder builder;
- builder
- .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, cm_fileno(stdin))
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, stdin)
.AddCommand(command);
if (dir) {
builder.SetWorkingDirectory(dir);
@@ -586,11 +583,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
if (outputflag == OUTPUT_PASSTHROUGH) {
captureStdOut = nullptr;
captureStdErr = nullptr;
- builder
- .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
- cm_fileno(stdout))
- .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(stderr));
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
} else if (outputflag == OUTPUT_MERGE ||
(captureStdErr && captureStdErr == captureStdOut)) {
builder.SetMergedBuiltinStreams();