mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 19:19:32 -05:00
Merge branch 'upstream-KWSys' into macOS-sw_vers-stderr
* upstream-KWSys: KWSys 2024-11-23 (3e9b0b88) Fixes: #26466
This commit is contained in:
@@ -4759,7 +4759,7 @@ std::string SystemInformationImplementation::ExtractValueFromSysCtl(
|
|||||||
std::string SystemInformationImplementation::RunProcess(
|
std::string SystemInformationImplementation::RunProcess(
|
||||||
std::vector<const char*> args)
|
std::vector<const char*> args)
|
||||||
{
|
{
|
||||||
std::string buffer;
|
std::string out;
|
||||||
|
|
||||||
// Run the application
|
// Run the application
|
||||||
kwsysProcess* gp = kwsysProcess_New();
|
kwsysProcess* gp = kwsysProcess_New();
|
||||||
@@ -4778,7 +4778,10 @@ std::string SystemInformationImplementation::RunProcess(
|
|||||||
(pipe == kwsysProcess_Pipe_STDOUT ||
|
(pipe == kwsysProcess_Pipe_STDOUT ||
|
||||||
pipe == kwsysProcess_Pipe_STDERR))) // wait for 1s
|
pipe == kwsysProcess_Pipe_STDERR))) // wait for 1s
|
||||||
{
|
{
|
||||||
buffer.append(data, length);
|
// Keep stdout, ignore stderr.
|
||||||
|
if (pipe == kwsysProcess_Pipe_STDOUT) {
|
||||||
|
out.append(data, length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
kwsysProcess_WaitForExit(gp, nullptr);
|
kwsysProcess_WaitForExit(gp, nullptr);
|
||||||
|
|
||||||
@@ -4808,7 +4811,7 @@ std::string SystemInformationImplementation::RunProcess(
|
|||||||
if (result) {
|
if (result) {
|
||||||
std::cerr << "Error " << args[0] << " returned :" << result << "\n";
|
std::cerr << "Error " << args[0] << " returned :" << result << "\n";
|
||||||
}
|
}
|
||||||
return buffer;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string SystemInformationImplementation::ParseValueFromKStat(
|
std::string SystemInformationImplementation::ParseValueFromKStat(
|
||||||
|
|||||||
Reference in New Issue
Block a user