summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-08-04 18:08:17 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-08-07 15:26:05 (GMT)
commitfbdb1fd84347f4dcb65a50b888e13ece07a367d7 (patch)
tree009cdfbd3543a7974dc25fee179d24f22a9cf296 /Source/cmake.cxx
parent21edd5af1f24d12612e3f6052b9497b848566855 (diff)
downloadCMake-fbdb1fd84347f4dcb65a50b888e13ece07a367d7.zip
CMake-fbdb1fd84347f4dcb65a50b888e13ece07a367d7.tar.gz
CMake-fbdb1fd84347f4dcb65a50b888e13ece07a367d7.tar.bz2
Source: Add cm_fileno wrapper
And use it where appropriate.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index b8ebca5..ae96cf9 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -23,14 +23,11 @@
#include <cmext/algorithm>
#include <cmext/string_view>
-#if !defined(CMAKE_BOOTSTRAP) && !defined(_WIN32)
-# include <unistd.h>
-#endif
-
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include "cmsys/RegularExpression.hxx"
+#include "cm_fileno.hxx"
#include "cm_sys_stat.h"
#include "cmBuildOptions.h"
@@ -3913,15 +3910,11 @@ std::function<int()> cmake::BuildWorkflowStep(
const std::vector<std::string>& args)
{
cmUVProcessChainBuilder builder;
- builder
- .AddCommand(args)
-# ifdef _WIN32
- .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, _fileno(stdout))
- .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, _fileno(stderr));
-# else
- .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, STDOUT_FILENO)
- .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, STDERR_FILENO);
-# endif
+ builder.AddCommand(args)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
+ cm_fileno(stdout))
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
+ cm_fileno(stderr));
return [builder]() -> int {
auto chain = builder.Start();
chain.Wait();